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.
VB Code:
  1. Dim mypic As StdPicture
  2. Picture1.AutoRedraw = True
  3. Picture2.AutoRedraw = True
  4.  
  5. 'load the picture into the stdPicture object
  6. Set mypic = LoadPicture("whatever.gif")
  7. 'display the image in a picturebox.  So far so good
  8. Picture1.PaintPicture mypic, 0, 0
  9.  
  10. 'create a memory device context
  11. Dim DC As Long
  12. DC = CreateCompatibleDC(Picture1.hDc)
  13. 'put the bitmap image from our stdPicture object into the DC
  14. Call SelectObject(DC, mypic.Handle)
  15.  
  16. 'Now it is ruined, picture2 won't display it properly
  17. 'no matter what I've tried
  18. Set Picture2.Picture = mypic
  19. Picture2.Refresh
  20.  
  21. 'tried this too
  22. 'Picture2.PaintPicture mypic, 0, 0
Anyone have any ideas?