First, you need to set the AutoRedraw property to True before you do the drawing - the system then knows to keep track of what you draw. Otherwise, it expects you to have a Paint event handler that will redraw it every time.
You can check if this is the problem by hiding the window behind another window and then bringing it to the front again - if the PictureBox isn't redrawn, then change the code to set AutoRedraw before drawing, and try again - it should now work as expected.
(The hide/show test may also be graphics-driver-dependant, so do the AutoRedraw thing even if it seems unnecessary after the first hide/show test.)
If that's working but it's still not saving correctly, try changing
to
and see if that works.
Finally, some people claim that setting the PictureBox's Picture property to the value of its Image property will work, but that sounds a bit voodoo chicken to me - also, the VB docs seem to suggest that the Picture property is read-only at runtime. But if all the above fails, give that a try - revert the change to the SavePicture call as well if you try this.
You can check if this is the problem by hiding the window behind another window and then bringing it to the front again - if the PictureBox isn't redrawn, then change the code to set AutoRedraw before drawing, and try again - it should now work as expected.
(The hide/show test may also be graphics-driver-dependant, so do the AutoRedraw thing even if it seems unnecessary after the first hide/show test.)
If that's working but it's still not saving correctly, try changing
Code:
SavePicture frmWfaxdisp.picDisplay.Picture, filetosave
Code:
SavePicture frmWfaxdisp.picDisplay.Image, filetosave
Finally, some people claim that setting the PictureBox's Picture property to the value of its Image property will work, but that sounds a bit voodoo chicken to me - also, the VB docs seem to suggest that the Picture property is read-only at runtime. But if all the above fails, give that a try - revert the change to the SavePicture call as well if you try this.
Comment