Lee Jenkins
2008-04-12 22:10:46 UTC
Hi all,
I'm having a problem with drawing text on an image using the DrawText function
where the area around the text masked out. Please see the attached image.
This same routine works perfectly in Delphi. Maybe the Canvas.Brush.Style :=
bsClear is not working?
procedure TMyImage.DrawCaption;
var
lRect: TRect;
begin
// setup rect
lRect.Left := 10;
lRect.Top := 10;
lRect.Right := Width -10;
lRect.Bottom := Height -10;
//Canvas.Pen.Style := psClear; // <-- tried this as well
Canvas.Font.Assign(FButtonFont);
Canvas.Brush.Style := bsClear;
DrawText(Canvas.Handle, PChar(FCaption), -1, lRect,
DT_WORDBREAK or DT_VCENTER or DT_CENTER or DT_END_ELLIPSIS);
end;
I'm having a problem with drawing text on an image using the DrawText function
where the area around the text masked out. Please see the attached image.
This same routine works perfectly in Delphi. Maybe the Canvas.Brush.Style :=
bsClear is not working?
procedure TMyImage.DrawCaption;
var
lRect: TRect;
begin
// setup rect
lRect.Left := 10;
lRect.Top := 10;
lRect.Right := Width -10;
lRect.Bottom := Height -10;
//Canvas.Pen.Style := psClear; // <-- tried this as well
Canvas.Font.Assign(FButtonFont);
Canvas.Brush.Style := bsClear;
DrawText(Canvas.Handle, PChar(FCaption), -1, lRect,
DT_WORDBREAK or DT_VCENTER or DT_CENTER or DT_END_ELLIPSIS);
end;
--
Warm Regards,
Lee
Warm Regards,
Lee