By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

Resize image for webpage

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.