Board index » delphi » Problem with gradientfill

Problem with gradientfill

Hi,

What is wrong with this code?

procedure TForm1.Button1Click(Sender: TObject);
begin
GradientFill( Canvas, ClientRect, clYellow, clBlue, True);
end;

When I want to run this project I get the following errors:

[Error] Unit1.pas(29): Incompatible types: 'HDC' and 'TCanvas'
[Error] Unit1.pas(29): Types of actual and formal var parameters must be
identical
[Error] Unit1.pas(29): Incompatible types: 'Integer' and 'Pointer'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

Does somebody have a solution for this problem?

P.S: The code above comes from an example of delphi.

Thanks.

 

Re:Problem with gradientfill


It was a bad example or the function was hand-made, i mean you are missing
someone's  implementation.
The only GradientFill function i know does not take these parameters.

GradientFill
[This is preliminary documentation and subject to change.]

The GradientFill function fills rectangle and triangle structures.

BOOL GradientFill(
  HDC hdc,
  CONST PTRIVERTEX pVertex,
  DWORD dwNumVertex,
  CONST PVOID pMesh,
  DWORD dwNumMesh,
  DWORD dwMode
);

Quote
"TP" <kevi...@pi.be> wrote in message

news:9ggc22$s20$1@news.planetinternet.be...
Quote
> Hi,

> What is wrong with this code?

> procedure TForm1.Button1Click(Sender: TObject);
> begin
> GradientFill( Canvas, ClientRect, clYellow, clBlue, True);
> end;

> When I want to run this project I get the following errors:

> [Error] Unit1.pas(29): Incompatible types: 'HDC' and 'TCanvas'
> [Error] Unit1.pas(29): Types of actual and formal var parameters must be
> identical
> [Error] Unit1.pas(29): Incompatible types: 'Integer' and 'Pointer'
> [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

> Does somebody have a solution for this problem?

> P.S: The code above comes from an example of delphi.

> Thanks.

Other Threads