Drawing in Pocket PC picture Box

P

Peter

Hi! I have a Picture Box in a pocket PC application and I don't know how to draw images in it since there isn't any Picture Box Paint event. How should I do it? Thanks!
 
F

Fabien

Hi,

You have the Paint event :
private void pictureBox1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
// Create a local version of the graphics object for the
PictureBox.
Graphics g = e.Graphics;

....Drav what you want wit the Graphics object

}

If you just want to set an image :

pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage ;
MyImage = new Bitmap("yourFilePath");

pictureBox1.Image = (Image) MyImage ;

BR


Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/


Peter a écrit :
 
V

vikash

Hello
Try looking for Signature Control on Pocket PC. It will help u in
making a class for drawing images and all.

Thanks n Regards
Vikash
 
P

Peter

Thanks Fabien, but you wrote as if the picture box in a device application had a Paint event and it doesn't...
 
F

Fabien

Hi Peter,

You must override the OnPaint method :
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
// Add your code here
}

BR


Fabien Decret
Windows Embedded Consultant


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/



Peter a écrit :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top