I am trying to paint an image from an imagelist to a picturebox on demand, not in the OnPaint event.
I am using
Me.picUserImage.Image = Me.ILUserIcons.Images(sGUID)
This works fine, but the image looks jagged.
Usually (when I am using OnPaint) I use the following code:
e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
e.Graphics.DrawImage(Me.ilUsers.Images(iImageIndex), nRect)
This works fine. But I am unable to set this smoothing mode in my on-demand sub.
Can someone tell me what I am doing wrong?