HighTechTalks DotNet Forums  

please help, bad image quality

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss please help, bad image quality in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jeff
 
Posts: n/a

Default please help, bad image quality - 11-06-2006 , 07:16 AM






Hey

ASP.NET 2.0

I created an image in PhotoShop XI and added it to my asp.net 2.0 project.
In my website project I have this code:
<asp:TableRow>
<asp:TableCell>
<asp:Image ID="imgBar" runat="server" ImageUrl="~/Network/Bar.aspx"
/>
</asp:TableCell>
</asp:TableRow>
Which sets the bar.aspx file as a image, this is basically a .aspx which
does nothing else than writing an image to it's Response.OutputStream

This is the code in the Page_Load of Bar.aspx:
Image imageFile = Image.FromFile(Server.MapPath("~/Images/test1.jpg"));
imageFile.Save(Response.OutputStream, ImageFormat.Gif);

As you see the code in the Page_Load does almost nothing. My intention is to
add more functionality later....

Okay, the problem is that the image generated by this Bar.aspx is in a bad
quality. Check this link and you see what I mean:
http://home.online.no/~au-holme/pub/23606/Default.html

What must I do so that the image generated by Bar.aspx looks the same as the
version done in PaintShop?

Please help me on this on!

Jeff




Reply With Quote
  #2  
Old   
Joergen Bech
 
Posts: n/a

Default Re: please help, bad image quality - 11-06-2006 , 07:43 AM







It looks bad because you are reading a jpg but sending it
to the client as a gif. In this case, a conversion and possible
degradation of the image will take place.

Try sending it as jpg instead.

/Joergen Bech



On Mon, 6 Nov 2006 13:16:45 +0100, "Jeff"
<it_consultant1 (AT) hotmail (DOT) com.NOSPAM> wrote:

Quote:
Hey

ASP.NET 2.0

I created an image in PhotoShop XI and added it to my asp.net 2.0 project.
In my website project I have this code:
asp:TableRow
asp:TableCell
asp:Image ID="imgBar" runat="server" ImageUrl="~/Network/Bar.aspx"
/
/asp:TableCell
/asp:TableRow
Which sets the bar.aspx file as a image, this is basically a .aspx which
does nothing else than writing an image to it's Response.OutputStream

This is the code in the Page_Load of Bar.aspx:
Image imageFile = Image.FromFile(Server.MapPath("~/Images/test1.jpg"));
imageFile.Save(Response.OutputStream, ImageFormat.Gif);

As you see the code in the Page_Load does almost nothing. My intention is to
add more functionality later....

Okay, the problem is that the image generated by this Bar.aspx is in a bad
quality. Check this link and you see what I mean:
http://home.online.no/~au-holme/pub/23606/Default.html

What must I do so that the image generated by Bar.aspx looks the same as the
version done in PaintShop?

Please help me on this on!

Jeff




Reply With Quote
  #3  
Old   
Jeff
 
Posts: n/a

Default Re: please help, bad image quality - 11-06-2006 , 08:24 AM




Thanks

"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> wrote

Quote:
It looks bad because you are reading a jpg but sending it
to the client as a gif. In this case, a conversion and possible
degradation of the image will take place.

Try sending it as jpg instead.

/Joergen Bech



On Mon, 6 Nov 2006 13:16:45 +0100, "Jeff"
it_consultant1 (AT) hotmail (DOT) com.NOSPAM> wrote:

Hey

ASP.NET 2.0

I created an image in PhotoShop XI and added it to my asp.net 2.0 project.
In my website project I have this code:
asp:TableRow
asp:TableCell
asp:Image ID="imgBar" runat="server" ImageUrl="~/Network/Bar.aspx"
/
/asp:TableCell
/asp:TableRow
Which sets the bar.aspx file as a image, this is basically a .aspx which
does nothing else than writing an image to it's Response.OutputStream

This is the code in the Page_Load of Bar.aspx:
Image imageFile = Image.FromFile(Server.MapPath("~/Images/test1.jpg"));
imageFile.Save(Response.OutputStream, ImageFormat.Gif);

As you see the code in the Page_Load does almost nothing. My intention is
to
add more functionality later....

Okay, the problem is that the image generated by this Bar.aspx is in a bad
quality. Check this link and you see what I mean:
http://home.online.no/~au-holme/pub/23606/Default.html

What must I do so that the image generated by Bar.aspx looks the same as
the
version done in PaintShop?

Please help me on this on!

Jeff






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.