You've already forked lazarus-ccr
aarre
applications
biffexplorer
cactusjukebox
draw_test
draw_test_fast
images
images_50
filecache.pas
mydrawingcontrol.pas
project1.ico
project1.lpi
project1.lpr
project1.res
unit1.lfm
unit1.pas
untitled.blend
fpbrowser
fpchess
fppkgrepotest
fpsvnsync
fpvviewer
gobject-introspection
idlparser
instantfpc
json_packager
khexeditor
lazclock
lazedit
lazeyes
lazimageeditor
lazspreadsheet
lazstacktrace
pyramidtiff
spready
tappytux
wikihelp
bindings
components
examples
lclbindings
wst
40 lines
709 B
ObjectPascal
40 lines
709 B
ObjectPascal
![]() |
unit MyDrawingControl;
|
||
|
|
||
|
{$mode objfpc}{$H+}
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
Classes, SysUtils, Controls, Graphics, LCLType;
|
||
|
|
||
|
type
|
||
|
|
||
|
{ TMyDrawingControl }
|
||
|
|
||
|
TMyDrawingControl = class(TCustomControl)
|
||
|
private
|
||
|
FBitmap: TPortableNetworkGraphic;
|
||
|
public
|
||
|
property Bitmap: TPortableNetworkGraphic read FBitmap write FBitmap;
|
||
|
procedure EraseBackground(DC: HDC); override;
|
||
|
procedure Paint; override;
|
||
|
end;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
procedure TMyDrawingControl.EraseBackground(DC: HDC);
|
||
|
begin
|
||
|
//Uncomment this to enable default background erasing
|
||
|
//inherited EraseBackground(DC);
|
||
|
end;
|
||
|
|
||
|
procedure TMyDrawingControl.Paint;
|
||
|
begin
|
||
|
if Assigned(Bitmap) then
|
||
|
Canvas.Draw(0, 0, Bitmap);
|
||
|
|
||
|
inherited Paint;
|
||
|
end;
|
||
|
|
||
|
end.
|