Files
lazarus-ccr/applications/fpchess/fpchessdrawer.pas
sekelsenmat c4882537eb Adds a new application to lazarusccr, fpchess
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1321 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2010-09-16 11:52:47 +00:00

60 lines
936 B
ObjectPascal

unit fpchessdrawer;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Controls, Graphics, LCLType;
type
{ TFPChessDrawer }
TFPChessDrawer = class(TCustomControl)
public
procedure EraseBackground(DC: HDC); override;
procedure Paint; override;
procedure DrawToCanvas(ACanvas: TCanvas);
end;
var
vFPChessDrawer: TFPChessDrawer;
implementation
procedure TFPChessDrawer.EraseBackground(DC: HDC);
begin
// Uncomment this to enable default background erasing
//inherited EraseBackground(DC);
end;
procedure TFPChessDrawer.Paint;
var
x, y: Integer;
Bitmap: TBitmap;
begin
Bitmap := TBitmap.Create;
try
// Initializes the Bitmap Size
Bitmap.Height := Height;
Bitmap.Width := Width;
DrawToCanvas(Bitmap.Canvas);
Canvas.Draw(0, 0, Bitmap);
finally
Bitmap.Free;
end;
inherited Paint;
end;
procedure TFPChessDrawer.DrawToCanvas(ACanvas: TCanvas);
begin
end;
end.