Solved

White colour on icon

Posted on 2003-11-28
4
392 Views
Last Modified: 2010-04-05
Hi,

I have an 8-colour 32 x 32 icon (.ico file), which I use throughout my program for its logo.  When it is displayed full-size in either Windows Explorer or in a TImage component, white parts on the image are displayed in white as expected.  However, when the icon is displayed half-size, such as when used as an icon in the form and appears on the taskbar, the white appears transparent, so grey (Window's background colour) shows up instead of white for those areas.

So why is it that when displayed full-size, white is correctly displayed but when it is half-size, white is transparent and appears grey?  I'd prefer it if the white areas on the image always appear white or at least be consistent when displayed in different sizes.

I'm using Windows '98 SE and Delphi 4 Pro.

Thanks in Advance,

Richard
0
Comment
Question by:Richard2000
4 Comments
 
LVL 7

Expert Comment

by:sftweng
ID: 9839501
Try dropping a single pixel of a colour you don't use into the bottom left corner - it's sometimes used as the "transparency" colour.
0
 

Expert Comment

by:mehdi_m
ID: 9839757
if you wanna show the icon in the title-bar of form's, by default it is transparent. when an image is transparent means that the transparent color of the image (left-bottom pixel's color of it) will be replaced with parent color. (as sftweng said before). and now if you want to have the same effect in logo or ... that you made. it depends on the component which do you use. for example if you use TImage, it's enough to set the transparent property to True.

hope to be usefull.

mehdi_m
0
 
LVL 34

Accepted Solution

by:
Slick812 earned 50 total points
ID: 9841007
hello Richard2000, Icons are completely Handled by the "windows system", and changing a pixel  probally will not change anything in your icon except that pixel, because the system gets it's Icon transpanency pixel definitions from a Black and White "MasK"  bitmap that is also in the Icon file wilth the color bitmap., If you are having trouble with the white areas becomeing transparent, it might be because the desingners of the Icon were not very good, and should have tested the Icon to see how it looked in the 16x16 size, The system will automatically make a 16x16 Icon if one is not in the Icon resource or file, and it will resize the "Mask" bitmap to 16x16, however, this resize can throw off some pixels because it has to average out some resized pixels. . . You might should get an Icon Editor, and include a 16x16 Icon in the Icon file along with a 32x32 icon and a 48x48 icon for windows XP. . . . I do not know of any way to get the system to alter the way it resizes an Icon, but a well made Icon will be tested and look OK in the 16x16 size
0
 

Author Comment

by:Richard2000
ID: 9851576
Hi,

Thank you for your help.

After looking at the icon further, I have found that the icon actually contains two images, one for 32 x 32 and one for 16 x 16 (I had originally assumed there was only one 32 x 32 image).  An area on the 32 x 32 image uses white, whilst the same area on the 16 x 16 image uses grey instead.  I assume that this is because as the 16 x 16 image is smaller, it does not need to be as bright in that area.  So everything appears to be working as expected.

There is no 48 x 48 image at present, but I can always add one in the future if required.

Richard
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi component that can load a DLL in design time? 8 92
Delphi IDE crash without error message ... 7 118
Dynamically Created Query 3 70
update joined tables 2 62
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question