![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |