.net Image resize?

They have: 5,633 posts

Joined: Jan 1970

Does ASP.NET have any built-in Image handeling classes for creating thumbnails? My hosting has a plug-in but their documentation is in VB, asp classic.

ServerObjects Inc.
ASPImage v2.01 (ASPImage.Image)

SearchBliss's picture

He has: 267 posts

Joined: Feb 2005

The image class in ASP.NET has the GetThumbnailImage() Method for resizing images. Search the web for more info.

They have: 5,633 posts

Joined: Jan 1970

thank you.
Its in System.Drawing.Image
I was looking in System.IO earlier

They have: 5,633 posts

Joined: Jan 1970

SearchBliss you have probably done this more than I have...

Here is what I got set up so far. I just need advice on how to finish it. I upload images for my blog to my server then they are stored in a offline folder. To recall a image I set the image tag with a src like this <img src="image.aspx?num=4">'
With a code like this for the image

switch(Itype){
case "jpg":
Response.ContentType = "image/JPEG";
break;
case "gif":
Response.ContentType = "image/GIF";
break;
default :
Response.Write("Unknown Type");
Response.End();
break;}

string Filename = logFunk.systemPath + "img\\dump\\" + focusNum + "." + Itype;

FileStream MyFileStream = new FileStream(Filename, FileMode.Open);
long FileSize = MyFileStream.Length;
      
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)FileSize);
MyFileStream.Close();

Response.BinaryWrite(Buffer);
'
So now I want to create a thumb nail of the image. I figure just add to the querystring and have it just display a smaller image. Example.... <img src="image.aspx?num=4&Tnail=true">'
The only problem is I have no idea how to do that....
Or the second option... open image.aspx as a image in the display page then modify it so its a Thumbnail, the only problem is I don’t want to save it on a web folder. And I don’t want a bunch of temp files filling my hosting space.

They have: 5,633 posts

Joined: Jan 1970

I think I need to post less... I figured it out. I went with the queary string option. Then deleted the old "byte stream" stuff. Now I I just opended the origional file, made a thumb nail them saved to output stream. Sounds simple right?

SearchBliss's picture

He has: 267 posts

Joined: Feb 2005

Good job.

They have: 5,633 posts

Joined: Jan 1970

One proublem though... When I use the Bitmap and Image class the picture quality goes down the tube. I think ill byte stream the large images and use the image class for the tNails

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.