views:

341

answers:

1

Hi

How I can Load Picture to PictureBox in Windows mobile ?

there isn't somthing like "PictureBox1.Image.Load (......." ???

thank's

+2  A: 

You need to create the image object, then assign it to the PictureBox:

Image myImage = new Bitmap(...);
PixtureBox1.Image = myImage;
jrista
I'd modify that slightly to Dispose any existing image before assigning the new one to prevent an OOM, especially if you load often.
ctacke
@ctacke: Good point. @Gold: Even though the GC will eventually handle it, Images require finalization which can cause them to stick around FAR longer than would otherwise be required. On a mobile device with little memory, you could run into an OOM before the GC has a chance to finish finalization.
jrista