[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Graphics/Palettes

Posted on 1997-05-23
4
Medium Priority
?
199 Views
Last Modified: 2010-04-04
Hi, I have a very specifik question.

I use Delphi2.0 and Win95.
I have a PageControl with some TabSheets on. On one of the TabSheets I have some free space. I would like to draw some lines in this free space in different colors. Afterwards I would like to be able to change the RGB-values of the colors used, resulting in the lines changing color.

My question is:
How do I easist draw the lines on the TabSheet in colors that I specify the RGB-values of (not an approximation) and how do I make myself able to afterwards change the RGB-values of these colors in order to make the lines change color????

Thanx - Steff

P.S: This question might belong in the MS-WINDOWS section, since the solution surely involves calls to misc Windows API functions/procedures.
0
Comment
Question by:steff
[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
  • 2
4 Comments
 

Expert Comment

by:W. Yang
ID: 1336557
It will be easier if you create a TLine object.liketypeTline = class(TObject)X1, X2, Y1, Y2 : Integer;Color: TColor;end;and you declare a array of Tline objects.var Lines: array[1..10] of TLinethen when you need to change the color or paint on the tabsheet just do a painting loop.for i := 1 to 10 dowith Lines[i] dobegin
Canvas.Line(X1, Y1, X2, Y2);Canvas.Pen.Color := Color;end;
Best Regards
0
 

Author Comment

by:steff
ID: 1336558
First of all - there are no answer of how to make colors available for my drawing on the TTabSheet. I should be able to set the RGB-value colors available to me.
Second - there are no answer of how to draw on the TTabSheet - as far as I know TTabSheet has no TCanvas directly connected. Correct me if I am wrong.
Last - and most important. I would have alot of lines and the colors should change in a running kind of way (not only once and the wait some time before doing it again). I am sure that I will have to go to palette-level.

Steff
0
 
LVL 3

Accepted Solution

by:
mheacock earned 300 total points
ID: 1336559
There is no accessible palette on the TTabSheet.

You'll find it easiest to fill in your empty space with a
TImage componentand draw your lines on it.

To animate the colours, you'll have to use a technique called
palette animation...what you do is locate the palette entry
that corresponds to one of your coloured lines and change that
value...your line will then change automatically.  This will
only work in paletted colour modes (i.e. 256 colours), it
will not work in 16/24/32 bit colour modes.

I have a Delphi palette animation example around here.  It is
something I found on the net last year...you could probably
find the same.  If you want me to send it to you, just post
your e-mail address here.
0
 

Author Comment

by:steff
ID: 1336560
I would like you to send me the palette animation example. send it to the addx:  

u960617@daimi.aau.dk

Thanx - Steff
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 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