Solved

bitmap with same color controls

Posted on 2004-04-08
10
475 Views
Last Modified: 2013-12-03
I have a bitmap of a block diagram on a form which has a grey background.  Placed on top of the bitmap are check boxes, comboboxes, labels, and other controls.

The problem I'm having is when the program is loaded on other computers with different color settings.  The clBtnface color is a different shade of grey.  Which makes the form look really cheesey.

I have tried saving the bitmap with different color levels,  i.e. 16, 256, 24Bit.  The setting needs to be the same as the computer your using at the time to come close to matching the colors.

What is the common way to do somthing like this.  Use a GIF with transparent backgound?  Set a constant  and assign the color I need for each control?  If this is the answer then do I assign the color in the form.create procedure?  Will it accept a color thats not in the property list?

Hope this makes sense.

Randy

0
Comment
Question by:ISGDude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10786277
clBtnFace is a system color, don't use clBtnFace, set it to the color you want - Example: clGray. This wil be the same color on all machines.

Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10786287
Also, yes, you can assign colors thats are not (constants) in the property drop dpwn list.


Shane
0
 

Author Comment

by:ISGDude
ID: 10786377
The clGray is too dark for my needs and the other default colors don't work.  Should I find the hex value for LtGrey for 256 colors and set the form color property to this?
Is there an easy way to find the hex color setting?
0
Industry Leaders: 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!

 
LVL 11

Expert Comment

by:shaneholmes
ID: 10786414
convert a hex color string to a TColor variable? Try this:
 
{
  sColor should be in XXXXXX format
  (X being a hex digit)
}
function
  HexToTColor( sColor : string )
    : TColor;
begin
  Result :=
    RGB(
      { get red value }
      StrToInt( '$'+Copy( sColor, 1, 2 ) ),
      { get green value }
      StrToInt( '$'+Copy( sColor, 3, 2 ) ),
      { get blue value }
      StrToInt( '$'+Copy( sColor, 5, 2 ) )
    );
end;


Shane
0
 
LVL 17

Expert Comment

by:mokule
ID: 10786504
Remember, for example for checkbox You should set not only Color but also Font.Color
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10786526
Here is an entire list of HEX colors

http://hotwired.lycos.com/webmonkey/reference/color_codes/

Shane
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10786574
? why not paint your bitmap-background transparent ?

use the onpaint event for painting yourself for ex.
(there are also other methods)

no time for a sample yet,
but other experts may pickup this suggestion,
lately tomorrow myself, if this will solve your problem

meikl ;-)
0
 

Author Comment

by:ISGDude
ID: 10787722
Well, I downloaded a color pallet program and it told me my bitmap background color was 0xc0c0c0 which turns out to be clSilver.  I changed the form to this color and everything matches except the menu bar.  

I still need to see what it looks like on other PCs.  

I think converting to Gif89 and making the backgound transparent is the way to go.  
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 250 total points
ID: 10787777
Did you try making your bitmap background transparent?

R U using a TImage? - You can set the transparent background color

Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10787790
If you decide to use GIF, check out this article on ABout.com

www.delphi.about.com

Working with GIF images in Delphi
ARTICLES :: Need to display an animated GIF image in a Delphi application? Even though Delphi does not natively support GIF image files formats (like BMP or JPEG) there are a few great (free source) components available on the Net, which add the ability to display and manipulate GIF images at run as well as at design time to any Delphi application.
Thursday April 08, 2004  #

http://www.delphi.about.com/library/weekly/aa040604a.htm

SHane

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
In this Micro Tutorial viewers will learn the basic shortcuts and functions in InDesign.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

734 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