PDA

Click to See Complete Forum and Search --> : How can you draw a line on an Image (not Picturebox)


IguanaMan
May 31st, 2000, 03:02 AM
I have tried to draw a simple line on an Image (rather than a picturebox) due to the image being capable of stretching while the picturebox is not.

For example I tried:

hPen = CreatePen(0, 1, RGB(255, 0, 0))
SelectObject Image1.Picture.Handle, hPen
Ellipse Image1.Picture.Handle, 5, 5, 30, 30

Image1.Refresh

to draw a simple ellipse on the image. Nothing appears. Is there any way to draw directly to an Image?

May 31st, 2000, 04:50 AM
ImageBoxes are just for decorations. They hardly do anything.

parksie
Jun 5th, 2000, 02:30 AM
Use a picturebox, and look at the documentation for StretchBlt, which allows you to draw the image to a memory space, then do a "stretching block transfer" to the picturebox's hDC (device context).