Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

26 Experts available now in Live!

Get 1:1 Help Now