Link to home
Start Free TrialLog in
Avatar of scml
scml

asked on

ImageList Draw method problem

Hi everybody,

I have a PictureBox on which there is an image control with an image covering the whole PictureBox.

I am using:

ImageList1.ListImages(1).Draw Picture1.hDC, posX, posY, 0

in a loop to draw multiple small images.

The problem is that when I open a new window and then close it, all the small images drawn using the imagelist draw method are erased exactly at the position the other window occupied.

Your solutions would me much appreciated.

SCML
Avatar of pierrecampe
pierrecampe

dont put an imagecontrol on the picturebox and use:
Picture1.AutoRedraw = True
Picture1.PaintPicture ImageList1.ListImages(1).Picture, posX, posY
ASKER CERTIFIED SOLUTION
Avatar of pierrecampe
pierrecampe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scml

ASKER

I tried your solution:

Picture1.AutoRedraw = True
Picture1.PaintPicture ImageList1.ListImages(1).Picture, posX, posY

and the drawing does not occur. But searching another source I found that it had to completed by:

Picture1.Refresh

Thanks

p.s.: for question: https://www.experts-exchange.com/jsp/qManageQuestion.jsp?

I am sending a comment.