storing signature written to picture box using plots to a bitmap

100karatdiamon
02-18-2005, 10:38 AM
Can any one help with storing a signature written to a picturebox using plots to a bitmap file? I have found loads of code which saves a bitmap image from a picturebox to a bitmap file but not if the image is just plotted.

I can print the plotted picturebox but not save it. surfing for the answer is giving me googly eyes!

OnErr0r
02-18-2005, 10:45 AM
I'm not 100% certain what you mean by "plots". I'll assume that is plotted points (PSet or SetPixel).


Option Explicit

Private Sub cmdSave_Click()
Dim i As Long

Picture1.AutoRedraw = True

For i = 0 To Picture1.ScaleWidth
Picture1.PSet (i, Picture1.ScaleHeight \ 2)
Next i

SavePicture Picture1.Image, "c:\foo.bmp"
End Sub

100karatdiamon
02-18-2005, 10:57 AM
Yes... Yes.. Yes.. Yes.. Thank you soooo much!

Only problem now is that when it runs through that code I get a horizontal line across the middle of the picturebox which is then stored to the file.

OnErr0r
02-18-2005, 11:18 AM
Yes... Yes.. Yes.. Yes.. Thank you soooo much!

Only problem now is that when it runs through that code I get a horizontal line across the middle of the picturebox which is then stored to the file.

haha.. that was just an example. The important points (no pun intended) there are, AutoRedraw must be True and SavePicture on PictureBox.Image.

100karatdiamon
02-18-2005, 11:22 AM
whoops! I was being stupid but I was already trying this line

"SavePicture signaturepic.Image, CommonDialog1.FileName"

and it was giving me an error before

thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum