469,909 Members | 1,855 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

Resize image for webpage

Hi,

I want to resize an image on my server.
I tried a lot of samples... but all the time it does resize and saves the
images but I can not view the image insize a webbrowser.
With an imageviewer (desktop application) I can view the image. I believe
there is something wrong with the maximum colors...

This is what I have now...
Image originalBitmap = Image.FromFile("C:\temp\image.jpg", true);
Image result = originalBitmap.GetThumbnailImage(150, 100, null,
IntPtr.Zero);
result.Save("C:\temp\resize.jpg");

Hope that someone have a good working sample. I want to read in images...
jpg and then resize (and viewable in browser).

Thanks!
Arjen
Aug 21 '06 #1
1 3567
Hmmm, solves the problem.

result.Save(directory + "resize.jpg",
System.Drawing.Imaging.ImageFormat.Jpeg);

Tnx 2 myself,
Arjen

"Arjen" <bo*****@hotmail.comschreef in bericht
news:ec**********@news5.zwoll1.ov.home.nl...
Hi,

I want to resize an image on my server.
I tried a lot of samples... but all the time it does resize and saves the
images but I can not view the image insize a webbrowser.
With an imageviewer (desktop application) I can view the image. I believe
there is something wrong with the maximum colors...

This is what I have now...
Image originalBitmap = Image.FromFile("C:\temp\image.jpg", true);
Image result = originalBitmap.GetThumbnailImage(150, 100, null,
IntPtr.Zero);
result.Save("C:\temp\resize.jpg");

Hope that someone have a good working sample. I want to read in images...
jpg and then resize (and viewable in browser).

Thanks!
Arjen

Aug 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Z D | last post: by
3 posts views Thread by Terry Williams | last post: by
2 posts views Thread by Carl Gilbert | last post: by
7 posts views Thread by windandwaves | last post: by
2 posts views Thread by Dominic Vella | last post: by
8 posts views Thread by infoseekar | last post: by
2 posts views Thread by jrsjrs | last post: by
3 posts views Thread by =?Utf-8?B?UiBSZXllcw==?= | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.