[Lazarus] Dynamically loaded resource file

Roland Turcan konf at rotursoft.sk
Fri Jun 20 14:34:07 CEST 2008


Marc Weustink wrote:
> Hi,
>
> Today i've committed a few graphics changes which might effect existing 
> applications.
>   

An simple application with a PaintBox and the following event handler in 
OnPaint does not work anymore. The width and Height of the bitmap are zero.

procedure TForm1.PaintBox1Paint(Sender: TObject);
var
  Bitmap: TBitmap;
begin
  Bitmap := TBitmap.Create;
  Bitmap.Width := PaintBox1.Width;
  Bitmap.Height := PaintBox1.Height;
  Bitmap.Canvas.Brush.Color := clWhite;
  Bitmap.Canvas.FillRect(0, 0, PaintBox1.Width, PaintBox1.Height);
  PaintBox1.Canvas.Draw(0, 0, Bitmap);
  Caption := Format('Bitmap Width: %d, Height: %d', [Bitmap.Width, 
Bitmap.Height]);
  Bitmap.Destroy;
end;

Luiz



More information about the Lazarus mailing list