Link to home
Start Free TrialLog in
Avatar of toff_in_sydney
toff_in_sydney

asked on

PaintPicture

I'm trying to clip a picture. I'm doing it by loading the picture into one picturebox, and using the PaintPicture method to paint a part of it into another picture box. Here's the code:

    Set picSource.Picture = LoadPicture(sFile)
    picDest.Width = iWidth * Screen.TwipsPerPixelX
    picDest.Height = iHeight * Screen.TwipsPerPixelY
    picDest.PaintPicture picSource.Picture, _
                         0, _
                         0, _
                         iWidth * Screen.TwipsPerPixelX, _
                         iHeight * Screen.TwipsPerPixelY, _
                         iLeft * Screen.TwipsPerPixelX, _
                         iTop * Screen.TwipsPerPixelY, _
                         iWidth * Screen.TwipsPerPixelX, _
                         iHeight * Screen.TwipsPerPixelY

But after the PaintPicture, picDest.picture is always 0. What am I doing wrong?
Avatar of crazyman
crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

set picDest.picture = picDest.Image ?
ASKER CERTIFIED SOLUTION
Avatar of crazyman
crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

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