Jump to content

Recommended Posts

Guest man9uk
Posted

C#.net help

anyone please help

you know with treeView control we normaly get "Bounds" property so we can find out the location/size of each node in treeView.

but in smart device application project we don't get "Bounds"property ;)

and i need to know the location of each node.

:??:How can i get "location" of each node. Please help :??:

Thank you soooo so much in advance.

Guest man9uk
Posted (edited)

hi all,

Question 1

how do we read/load image from file

(e.g bla\file.jpg) into the image object in MOBILE APPLICATION???

???

for example

protected override void OnPaint(PaintEventArgs e)

{

Graphics g = e.graphics;

Image pic = new Image();

// here i need to read pic from some location "bla\file.jpg"

// how do i do the loading image into object "pic"

graphics.DrawImage(pic, x,y)

}

what code do i need instead of comments??

please help thanks ;)

Edited by man9uk
Guest mgama
Posted

You could create a new topic, rather than replying to 2 different threads.

One answer to your question is:

protected void MyOnPaint(PaintEventArgs e)

{

Graphics g = e.graphics;

Bitmap myPicture = new Bitmap("\\storage\\mypicture.jpg");

g.DrawImage(myPicture,x,y);

}

However DrawImage had 4 other ways you can call it, each drawing it slightly differently. For example, if your Graphics g object has a size of 100x200, but your graphic is 640x480, you can specify to have the image stretched/shrunk to fit a specified size. You can figure out the sizes by myPicture.Width and myPicture.Height, and/or g.Clip.Width or g.Clip.Height.

Guest man9uk
Posted (edited)

...

....

protected void MyOnPaint(PaintEventArgs e)

{

  Graphics g = e.graphics;

  Bitmap myPicture = new Bitmap("\\storage\\mypicture.jpg");

  g.DrawImage(myPicture,x,y);

}

However ..... ....... ...d/or g.Clip.Width or g.Clip.Height.

<{POST_SNAPBACK}>

Thanks I'll try that. :) :D :D :lol:

I was not sure about "Bitmap("\\storage\\mypicture.jpg");"line of code. i thought it doesn't work like that in mob app but :lol: thanks for making it clear. i'll try that soon.

May i ask another ques?...here...

Can we get this picture from camera instead of some "\\storage\\bla.jpg"

i guess yes but if really yes then how complicate will that be...? :??:

some code would also help but thanks for as much as you can.

Edited by man9uk
Guest man9uk
Posted (edited)

:shock:

wating for reply..

Edited by man9uk
Guest mgama
Posted (edited)

May i ask another ques?...here...

Can we get this picture from camera instead of some "\\storage\\bla.jpg"

i guess yes but if really yes then how complicate will that be...? :??:

some code would also help but  thanks for as much as you can.

<{POST_SNAPBACK}>

Of course you can ask another question. I was just suggesting that if you created a new topic your question it would probably get more people to look at it, and potentially more answers. I personally read most threads. If I've read the thread before, and didn't have anything to contribute, I sometimes won't read any future replies to the same thread. I'm just trying to help you get your questions out there in front of as many eyes as possible. :)

If you want to tap into the camera, your best bet is to use the APIs that are found in Windows Mobile 5. Granted, there are no commercially available phones that you can buy with WM5 on it, but there will be in the future. WM5 has added a new API that allows you to tap into the camera, as well many other aspects of the phone.

Sadly, I don't think there is a reliable way to do what you are looking for in Windows Mobile 2003 or older.

Edited by mgama
Guest man9uk
Posted

Thank you..I'll do that next time

and Thanks so much for the help :) :D :D

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.