473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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 3731
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
3
by: Terry Williams | last post by:
Let me see If I can explain this correctly. This is in VB.NET, an web application Say I have an image that I want to be displayed at 140px x 140px. Someone uploads an image 300px x 150px, I...
2
by: Carl Gilbert | last post by:
Hi I am looking for either a component or technique to allow me to do the following: * Provide a panel with a background image * Resize the image to best fit the panel to maintain aspect...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
7
by: windandwaves | last post by:
Hi Folk I use a pop-up window on www.wapitipark.co.nz to view images. On some sites, I saw (a long time ago) a trick where they use Javascript to resize the window to the size of the image. ...
2
by: Dominic Vella | last post by:
Hi, I know I seem to have the really complicated questions, but I guess that's why I'm here. This is a little verbose, only because I've been trying to crack this for a week now. Your help...
8
by: infoseekar | last post by:
Image Resize & Rotation Hi I have 2 scripts, one for Image rotation and other image resize and they both are working. Image resize scripts load the picture and resize it and Image rotation...
2
by: jrsjrs | last post by:
Some Java Applets have a very small output on the screen. There are many ways to enlarge text and images on a webpage, but none of these methods affect a java applet size. Is there any way to...
3
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi! This discussion may help other programmers get a better idea of how to save uploaded images through a website. Why? Well currently, I save 3 versions of every uploaded image on my own...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.