Board index » delphi » Color Fading: Like Setup programs: How to

Color Fading: Like Setup programs: How to

Quote
"{Unknown}" <z...@solo.pipex.co.za> wrote:
>Greatings again...
>Some "SETUP" programs have a color fading background -
>Starts with BLUE on the top of the window and ends with BLACK at the
>bottom.
>I can do this in 16M color mode - but it does not look so good - AND in 16
>color mode
>I just get the two colors
>1) How do I do this properly?
>Mail me direct at:
>v...@dmtc.co.za
>Thank you once again...
>Vino Rodrigues

The following code is taken from 'Instant Delphi Programming' by Dave
Jewell (Wrox press).  Use this to override the forms Paint method:

procedure TForm1.Paint;
var
  Row, Height : Integer;
begin
  Height := (ClientHeight + 255) div 256;
  for Row := 0 to 255 do begin
    Canvas.Brush.Color := RGB(0,0,Row);
    Canvas.FillRect(Rect(0,Row*Height,ClientWidth,(Row+1)*Height));
    end;
end;

Regards,

Duncan
LECS Ltd
Naantali, Finland
Tel: +358 2 81 41 309
Fax: +358 2 43 56 489
All types of programming work undertaken.

 

Re:Color Fading: Like Setup programs: How to


Greatings again...

Some "SETUP" programs have a color fading background -
Starts with BLUE on the top of the window and ends with BLACK at the
bottom.

I can do this in 16M color mode - but it does not look so good - AND in 16
color mode
I just get the two colors

1) How do I do this properly?

Mail me direct at:
v...@dmtc.co.za

Thank you once again...
Vino Rodrigues

Other Threads