drama22
asked on
how do i remove white background in node inside virtual TVirtualStringTree?
i am currently try to remove node background white color i try to use TargetCanvas.Brush.Style := bsClear; inside BeforeCellPaint event but the white background of node still visible how do i remove that white back ground color of node ? here what i tried
procedure TForm2.VTs1BeforeCellPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
var Data: PUData;
begin
Data := VTS1.GetNodeData(Node);
if not Assigned(Node) then Exit;
TargetCanvas.Brush.Style := bsClear;
end;
What do you mean with remove, what should be in the background of the cell?
ASKER
procedure TForm1.VirtualStringTree1B eforeCellP aint(Sende r: TBaseVirtualTree;
TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
begin
TargetCanvas.Brush.Color := clRed;
TargetCanvas.FillRect(Cell Rect);
end;
TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
begin
TargetCanvas.Brush.Color := clRed;
TargetCanvas.FillRect(Cell
end;
ASKER
this is not transparent this i will fill red color i don't want color at all
Seems that there is no transparency setting for TVirtualStringTree node Backgrounds.
The only way I can think of to simulate transparency for VirtualStringTree cells, is to copy convenient bitmap portions onto the canvas, so that it looks like the cell background is transparent.
Check this for further help
http://www.codegur.net/5567536/how-do-i-create-nodes-with-transparent-backgrounds-in-a-tvirtualdrawtree
The only way I can think of to simulate transparency for VirtualStringTree cells, is to copy convenient bitmap portions onto the canvas, so that it looks like the cell background is transparent.
Check this for further help
http://www.codegur.net/5567536/how-do-i-create-nodes-with-transparent-backgrounds-in-a-tvirtualdrawtree
ASKER
i read this before on stackoverflow i cannot apply the steps of the answer can you help me with it ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I fail to apply the bitbit part can you show me full delphi sample with no color nodes ? I doubt this is not what I need
ASKER
****** looks like very hard to find a way :) ******
Set Background (property - TPicture) of VirtualStringTree ....
VirtualStringTree.Background.LoadFromFile(...);
ASKER
Whats vts background picture has to do with cell node ? This will not help at all ,
also @thomas BitBlt(TargetCanvas.Handle , 0, 0, MyBmp.Width, MyBmp.Height, MyBmp.Canvas.Handle , 0, 0,
SRCCOPY);
did not work at all or even a bit
also @thomas BitBlt(TargetCanvas.Handle
SRCCOPY);
did not work at all or even a bit
ASKER
accepted because its gives me idea to solve . thank Thomas