Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any websites/examples about processing images in .Net? 2

Status
Not open for further replies.

eramgarden

Programmer
Joined
Aug 27, 2003
Messages
279
Location
US

I worked on a Java app that took a TIF file, added a line of text to the bottom of it, converted it to a GIF file and put it in a folder...

I want to do the same thing in .Net and i think i can use Graphics class...

Anyone has a good website/examples i can use to get me started?

Thanks
 
Here is an example of converting a Tif to Gif.
Bitmap test = new Bitmap(Iurl);//file path;
Response.ContentType="image/Gif";

System.Guid [] sg = test.FrameDimensionsList;
int FrameCount = test.GetFrameCount(new System.Drawing.Imaging.FrameDimension(sg[0]));
//Decide which frame you want 0 based;
int FrameIndex = 0;//Your choice;
test.SelectActiveFrame(new System.Drawing.Imaging.FrameDimension(sg[0]),FrameIndex);

test.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Gif);
test.Dispose();
//I have dumped the output to a stream and set the contenttype to the image/gif property. Most browsers will render the image;

As for text at the bottom you will have to use an Image class object (rectangle with text) and overlay it.
check the System.Drawing namespace for stuff.
check this site for the namespace info
 
One question:

How is the interface of this app?? it's not a website..so, it's a standalone app with ???

Just need an idea of how the big picture looks like...
 
This is just a sample of how to convert the image from tif to gif. To have this image appear in a browser you need to put the above code in your Page_Load event.
Notice that I have the image saved using the Response.OutputStream class. This will fill the browser with your image. To have your image appear in a set section of a web page, you have to create an image control. Set the image control's source to a webpage that has the above code in its Page_Load event.

Klaz
 
The technology you want to look into is called GDI+. Image processing is pretty darn easy and powerful in .NET!
 
Thanks a lot for all the help...

One question...

I'm new to .Net...where would this code go? in a Form, in a class..if in a function/sub...I want to use VB.Net instead of ASP.Net...
Thanks so much..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top