473,385 Members | 1,312 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,385 software developers and data experts.

ASP.NET-VB - How to clear Gamma from Streamed .png images

This is quite an annoying problem while Internet Explorer does not properly display colors of generated and streamed .png images. Below is quite simple code to produce a square rendered with #767676. IE displays completely wrong color, while other browsers do not.

I’ve read somewhere it is possible to remove gamma form the image for proper rendering in IE. But no idea how to properly do it… or if this at all possible. Anyone can help?

Thanks.


Expand|Select|Wrap|Line Numbers
  1. <%@ Import Namespace=System.Drawing %>
  2. <%@ Import Namespace=System.Drawing.Imaging %>
  3. <%@ Import Namespace=System %>
  4. <%@ Import Namespace=System.Web %>
  5. <%@ Import Namespace=System.Runtime.InteropServices %> 
  6. <%@ Import Namespace=System  %>
  7. <%@ Import Namespace=System.IO  %>
  8.  
  9. <%
  10.  
  11.     Dim MStream As New MemoryStream()
  12.     Dim full_thumb As New Bitmap(200, 200)
  13.     Dim gr_square As Graphics = Graphics.FromImage(full_thumb)
  14.     gr_square.FillRectangle(New SolidBrush(Color.FromArgb(255, 118, 118, 118)), 0, 0, 200, 200)
  15.     Response.ContentType = "image/png"
  16.     full_thumb.Save(MStream, ImageFormat.Png)
  17.     MStream.WriteTo(Response.OutputStream)
  18.     full_thumb.Dispose()
  19. %> 
  20.  
Sep 4 '07 #1
0 838

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
0
by: Georgeo Pulikkathara[MS] | last post by:
ASP.NET Webcast Week - January 19 - 23, 2004 Learn about ASP.NET from the experts! These free webcasts are live and interactive. Live code demos and attendees asking in depth engaging questions are...
0
by: Georgeo Pulikkathara[MS] | last post by:
ASP.NET Webcast Week - January 19 - 23, 2004 Learn about ASP.NET from the experts! These free webcasts are live and interactive. Live code demos and attendees asking in depth engaging questions are...
9
by: Bob | last post by:
Is ASP.NET 1.1 available on the 64 bit extended version of Windows 2003 Server? When I install VS.NET 2003 I then get Service Unavailable from IIS when navigating to the main under construction...
13
by: Kenneth Windish | last post by:
Hi, I wrote a simple web application using web matrix. When I run it on my local computer all works fine, but when I run it on hosting site all hyperlinks are not working and just postback to...
1
by: abh1508 | last post by:
Following a release of code the following problem occurs on certain asp ..net pages. This is not a problem on other testing/demo environments. IIS seems to be creating certain files twice in the...
14
by: David Lozzi | last post by:
Hello, I am in need of some advice. I want to move to .Net 2.0 and Visual Studio 2005 for ASP.NET developement, however I'm hesitant. Here are a few questions I have regarding the upgrade: 1)...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
0
by: Hernan Garber | last post by:
Hi, Attached, the installation log. Win 2k Server SP3 IE6SP1/SQL Server Installed Thanks Setup.exe: Setup.exe: ========== Logging started ==========
7
by: abcd | last post by:
I have asp.net application which was tested and developed on asp.net 1.1. WIll my application work on asp.net 2.0 also. Can I say asp.net 2.0 is supported automatically for the applications which...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.