Board index » delphi » Problem with Custom draw Tlistview

Problem with Custom draw Tlistview

I am trying to set up Tlistview's Background with a image.

and in OnCstemDraw Event Coding

procedure TForm1.ListView1CustomDraw(Sender: TCustomListView;
  const ARect: TRect; var DefaultDraw: Boolean);
begin
  ListView1.Canvas.Draw(0, 0, Bitmap1);
end;

Run application Background View as well
the Problem is Icon display not Transparent

How Can I Fix this Problem ?

 

Re:Problem with Custom draw Tlistview


JIANGTAO <jiang...@163.net> p1e v diskusnm p?spvku:3b145f8a_2@dnews...

Quote
> I am trying to set up Tlistview's Background with a image.

> and in OnCstemDraw Event Coding

> procedure TForm1.ListView1CustomDraw(Sender: TCustomListView;
>   const ARect: TRect; var DefaultDraw: Boolean);
> begin
>   ListView1.Canvas.Draw(0, 0, Bitmap1);
> end;

> Run application Background View as well
> the Problem is Icon display not Transparent

> How Can I Fix this Problem ?

Try
set properties of Bitmap1:

TransparentColor: TColor;
property Transparent: TTransparentMode;

or property of ListView.Canvas:

property CopyMode: TCopyMode default cmSrcCopy;

Now I am not sure what will work.
Lukas

Re:Problem with Custom draw Tlistview


  Hi

  Try setting Bitmap1's Transparent property to True.

  HTH

Quote
"JIANGTAO" <jiang...@163.net> wrote in message news:3b145f8a_2@dnews...

: I am trying to set up Tlistview's Background with a image.
:
: and in OnCstemDraw Event Coding
:
: procedure TForm1.ListView1CustomDraw(Sender: TCustomListView;
:   const ARect: TRect; var DefaultDraw: Boolean);
: begin
:   ListView1.Canvas.Draw(0, 0, Bitmap1);
: end;
:
: Run application Background View as well
: the Problem is Icon display not Transparent
:
: How Can I Fix this Problem ?
:
:

Other Threads