I have a memory DC that has an image in it and I'm trying to put that image into a stdPicture object. Here is an example that illustrates.Anyone have any ideas?VB Code:
Dim mypic As StdPicture Picture1.AutoRedraw = True Picture2.AutoRedraw = True 'load the picture into the stdPicture object Set mypic = LoadPicture("whatever.gif") 'display the image in a picturebox. So far so good Picture1.PaintPicture mypic, 0, 0 'create a memory device context Dim DC As Long DC = CreateCompatibleDC(Picture1.hDc) 'put the bitmap image from our stdPicture object into the DC Call SelectObject(DC, mypic.Handle) 'Now it is ruined, picture2 won't display it properly 'no matter what I've tried Set Picture2.Picture = mypic Picture2.Refresh 'tried this too 'Picture2.PaintPicture mypic, 0, 0




Reply With Quote