ProtekNickz
Well-known member
Hi their
,
I'm writing a small program that saves the Current background image to file once i have drawn on it too, here's what it does :
once i draw on previous image loaded in picturebox, the program then resizes it and save it at my chosen format, Code Bellow.
My problem is the image resizes all fine and save as the format i want, but the new pen i have applied wont save on the image,
Example: Image Loaded Countryside.png, then i Draw on the image ect.. and save, to no avail my pen is not saved on the image.
Maybe i'm missing somthing out here as i've racked my head mulitple times..... and change code over and over againn.......
Cheers for any help in advance.
I'm writing a small program that saves the Current background image to file once i have drawn on it too, here's what it does :
once i draw on previous image loaded in picturebox, the program then resizes it and save it at my chosen format, Code Bellow.
VB.NET:
Dim bm As New Bitmap(PicCharSKin.Image)
Dim MyWidth As Integer = CInt(Val(64)) 'image width.
Dim MyHeight As Integer = CInt(Val(32)) 'image height
Dim thumb As New Bitmap(MyWidth, MyHeight) 'Gets image's new size details
Dim gfxG As Graphics = Graphics.FromImage(thumb) 'Creates new image
gfxG.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias 'Smooth image on redrawing
gfxG.DrawImage(bm, New Rectangle(0, 0, MyWidth, MyHeight), New Rectangle(0, 0, bm.Width, bm.Height), GraphicsUnit.Pixel) 'Redraws the actual image
savChar.FileName = "char.png" 'Sets filename
savChar.Filter = "Portable Network Graphics (*.png)|*.png" 'Sets File Type
savChar.ShowDialog() 'Shows SaveDialog
thumb.Save(savChar.FileName, System.Drawing.Imaging.ImageFormat.Png) 'Saves Picture and sets format, Could use any almost image format
My problem is the image resizes all fine and save as the format i want, but the new pen i have applied wont save on the image,
Example: Image Loaded Countryside.png, then i Draw on the image ect.. and save, to no avail my pen is not saved on the image.
Maybe i'm missing somthing out here as i've racked my head mulitple times..... and change code over and over againn.......
Cheers for any help in advance.