Solved

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

Posted on 1997-05-31
1
147 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now