Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 23rd, 2006, 07:30 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display icon on a webpage

Hi

I need to display an .ico file on a webpage. i have the image/icon saved as bytes in the database. From there i read it and have to render on a webpage. The problem is that to display i need to convert it to bmp format and set teh mime type to image/bmp. this causes the icon to loose its transparency and instead black color appears. Any ideas how to sole this

thanks

Reply With Quote
  #2 (permalink)  
Old February 23rd, 2006, 07:36 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your problem is a documented bug (822488), here's a work around.

System.Drawing.Icon Icon1;
Icon1 = new System.Drawing.Icon("c:\\Example.ico");
e.Graphics.DrawIcon(Icon1,0,0);

See the following link for more details: http://www.kbalertz.com/Feedback_822488.aspx

- A.Kahtava
Reply With Quote
  #3 (permalink)  
Old February 24th, 2006, 06:37 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply.
But my prblem is displaying on a webpage.

Reply With Quote
  #4 (permalink)  
Old February 24th, 2006, 08:12 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Take a look at the IconExtractor class on the following link:

http://www.codeproject.com/aspnet/As...IconsImage.asp

The Author of the above tutorial seems to have solved the problem.

The Author writes:
IE has a flaw in transparent PNG rendering, causing the transparent areas to render gray. The code includes comments that help you change the implementation from PNG to GIF, losing the transparent background.

The implementation of transparent background in GIF images is way too complicated in .NET, involving unsafe blocks of code, so I decided not to include it in this sample, for the sake of simplicity.

- A.Kahtava
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display icon and form caption vickyj Beginning VB 6 1 January 31st, 2006 05:55 AM
How to display a access webpage on current date kenbeyond Access VBA 2 October 13th, 2005 06:42 AM
read field description and display on webpage wpiass Access ASP 7 October 5th, 2005 06:41 AM
to display an icon in datagrid deeraj ADO.NET 4 March 30th, 2005 02:00 AM
display a pdf in a webpage crmpicco Classic ASP Basics 3 February 8th, 2005 09:59 AM



All times are GMT -4. The time now is 12:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.