Главная страница | назад





Article #17079: drawing transparent text onto a TBitmap

 Question and Answer Database

FAQ2079D.txt   drawing transparent text onto a TBitmap
Category   :VCL
Platform    :All
Product    :All 32 bit  

Question:
How can I draw transparent text on a TBitmap?

Answer:
The following example demonstrates drawing transparent text on 
the canvas of a TBitmap.

Example:

procedure TForm1.Button1Click(Sender: TObject);
var
  OldBkMode : integer;
begin
  Image1.Picture.Bitmap.Canvas.Font.Color := clBlue;
  OldBkMode := SetBkMode(Image1.Picture.Bitmap.Canvas.Handle,
                         TRANSPARENT);
  Image1.Picture.Bitmap.Canvas.TextOut(10, 10, 'Hello');
  SetBkMode(Image1.Picture.Bitmap.Canvas.Handle,
            OldBkMode);
end;

7/16/98 4:31:28 PM
 

Last Modified: 01-SEP-99