Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Saving an image boxes content as .png?


  • Please log in to reply
1 reply to this topic

#1 Wolfy87

Wolfy87

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:04:14 AM

Posted 07 June 2009 - 04:28 AM

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.

BC AdBot (Login to Remove)

 


#2 Wolfy87

Wolfy87
  • Topic Starter

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:04:14 AM

Posted 07 June 2009 - 04:43 AM

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

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users