I\'m trying to do a signature capture program and save the customer signature to a PNG
or BMP
format. I have the Picturebox code working great and
When wanting to save as BMP, the background needs to be white because BMP doesnt support Transparency. With that being said, I have added these 2 lines above the DrawPath call.
Dim Brsh As SolidBrush = New SolidBrush(Color.White)
g.FillRectangle(Brsh, 0, 0, pBoxSignature.Width, pBoxSignature.Height)
g.DrawPath(signaturePen, gPath)
BUT, Now I am no longer able to pickup my pen stroke otherwise all previous strokes get erased/cleared. (Meaning first and last names need to be written without pickup up pen) Could someone with more knowledge on images perhaps see a reason for this and point me in the direction of a solution?
UPDATE: Working Code
Here is the code:
Using imgSignature As Bitmap = New Bitmap(pBoxSignature.Width, pBoxSignature.Height, PixelFormat.Format32bppRgb)
Using g As Graphics = Graphics.FromImage(imgSignature)
g.FillRectangle(Brsh, 0, 0, pBoxSignature.Width, pBoxSignature.Height)
Call DrawSignature(g)
End Using
imgSignature.Save(signaturePath, ImageFormat.Bmp)
pBoxSavedSignature.Image = New Bitmap(imgSignature)
End Using