Help - Search - Members - Calendar
Full Version: Saving an image boxes content as .png?
BleepingComputer.com > Software > Programming
   
Wolfy87
Hi, I am creating a program for my dad that helps him do his job, he fills in all of the boxes and then it creates the appropriate forms for him, I made it so it outputted in HTML which works great, although this is easyly editable, I have come up with the idea of outputting it as a image (png to be more specific), i would have to create my own font and system etc but i am willing to do that, anyway i would load an image into an image box and use set pixel to manipulate an image, after this i would need to save that image as a png, is this possible? If not i did look into converting it to a pdf, this seems only achevable with a sdk, is there any other way?

Thank you, Wolfy87.
Wolfy87
ok, worked it out and refined the code a little, here it is for any people that want to know =)

CODE
Imports System.Drawing.Imaging

Public Class MainClass

    Private Sub MainClass_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim MyImage As New Bitmap(256, 256)
        Dim gr As Graphics = Graphics.FromImage(MyImage)
        gr.Clear(Color.White)
        gr.DrawEllipse(Pens.Red, 0, 0, MyImage.Width - 1, MyImage.Height - 1)
        gr.DrawLine(Pens.Green, 0, 0, MyImage.Width - 1, MyImage.Height - 1)
        gr.DrawLine(Pens.Blue, MyImage.Width - 1, 0, 0, MyImage.Height - 1)
        MyImage.Save("test.PNG", ImageFormat.Png)
        Me.Close()
    End Sub
End Class
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.