Solved

How to bypass the Windows system palette for colorbanding (gradient colors)

Posted on 1997-05-31
1
151 Views
Last Modified: 2010-04-06
In a D2 app. I present sampled data in trendcurves, using normal Delphi
routines like Canvas.MoveTo, Canvas.LineTo etc.
Now i'd like to extend the capabilities and plot the data as you sometimes
can see it in a wheather chart (all colors having gradients).
If I use the normal Delphi methods, the colors are rounded to the
NearestColor. That's not what I want since I know the video card is able to
display more precise colors.
Can anyone help me or explain it a little bit?
(Note: I already have digged into sourcecode of gradientform,
gradientcaption and gradientbutton, all found on DSP but that's not giving
the right solution).
Many thanks in advance.

0
Comment
Question by:elpeedee
1 Comment
 
LVL 4

Accepted Solution

by:
StevenB earned 50 total points
ID: 1336699
 There are many solutions to the problem involving palette manipulation etc. however I suspect that the quickest solution for you will be this:

  If you use LineTo to generate the display output then you are using a Pen to generate the colour(color, are you un the US?). Pen colours are always rounded as you say to the nearest palette entry. If however you use a Brush to define the colour then the diplay will dither the colours for you as you are requesting. To use a Brush then you simply have to use the Rectangle command, for example, rather than a LineTo.

  Incidentally, in high colour mode the pen colours will be displayed correctly as the palette will have enough entries to accurately represent your output.

  Steven.
0

Featured Post

Technology Partners: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…

680 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