Hallo allemaal
Wat is er mis met onderstaande procedure?
Met een vriendelijke groet, Frans
Code:
procedure TForm1.FormPaint(Sender: TObject);
var
image: TBGRABitmap;
C: TBGRAPixel;
AText : String;
ACanvas : TCanvas;
W : Integer;
begin
AText := 'Hello world';
ACanvas := TCanvas.Create;
W := ACanvas.TextWidth(AText); // ************************************** wat gaat hier fout
Image := TBGRABitmap.Create(W,ClientHeight, ColorToBGRA(ColorToRGB(clBtnFace)) );
C := ColorToBGRA(ColorToRGB(clBtnText)); //retrieve default text color
Image.FontHeight := 30;
Image.FontAntialias := true;
Image.FontStyle := [fsBold];
Image.TextOut(5,5,AText,C);
Image.SetPixel(5,5,C);
Image.Draw(Canvas,0,0,True);
Image.free;
ACanvas.Free;
end;
Bookmarks