SavePicture Picture1.Picture?

01-22-2005, 08:52 AM
Hi All

I've got a slight problem with the SavePicture function, I have made a simple Graph drawing program in VB, it uses the line and PSet functions to draw the coordinates. It works real good, but I can't save the graph. My code for saving
SavePicture Graph.Picture, "C:\temp.bmp" This says Invalid picture, and when I hover my mouse above the Graph.Picture part, it says Graph.Picture = "0"... Can someone tell me how I can save my Graph???


PS Hope I gave all the info necessary to solve my problem

01-22-2005, 09:48 AM
I believe you need to save the picture boxe's image. This is the area that is saved in memory when you draw on the object. Autoredraw must be set to True for the image to be available. VB reserves a memory DC to draw to so that your current image can be updated if something clips the draw area or you minimize the object, etc. Try this to see if it works. It will save the image property of the picutre box control:

'Set Picture1.AutoRedraw to True in your Load or drawing routine.
SavePicture Me.Picture1.Image, "C:\temp.bmp"

01-26-2005, 12:54 PM
Ok, Thx a lot... :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum