Picturebox & StretchBlt



Hi all,

I've got this code:

Dim lWidth As Long
Dim lHeight As Long
Dim myPicture as StdPicture

myPicture.LoadPicture "somepicture"

pbxPicture.Picture = myPicture

If Not myPictureIs Nothing Then
lWidth = pbxPicture.ScaleX(myPicture.Width, vbHimetric, vbPixels)
lHeight = pbxPicture.ScaleY(myPicture.Height, vbHimetric, vbPixels)

SetStretchBltMode pbxThumb(0).hdc, HALFTONE
StretchBlt pbxThumb(0).hdc, 0, 0, 64, 64, _
pbxPicture.hdc, 0, 0, pbxPicture.ScaleWidth,
pbxPicture.ScaleHeight, SRC_COPY
End If

The code should load a picture in original size in the pbxPicture and a
thumbnail copy in the pbxThumb(0). The pbxPicture works fine, but the
thumbnail picturebox remains empty.

Any ideas?

Thanks,
Ivan


.



Relevant Pages