initial commit
[rofl0r-KOL.git] / demos / bitmap2paintbox / MainPaintBitmap.pas
blob7e34ac0932aa5c9e02fdcbc3bcd6e1a66c0d0bde
1 { KOL MCK } // Do not remove this line!
2 {$DEFINE KOL_MCK}
3 unit MainPaintBitmap;
5 interface
7 {$IFDEF KOL_MCK}
8 uses Windows, Messages, ShellAPI, KOL {$IFNDEF KOL_MCK}, mirror, Classes {$ENDIF};
9 {$ELSE}
10 {$I uses.inc}
11 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
12 {$ENDIF}
14 type
15 {$IFDEF KOL_MCK}
16 {$I MCKfakeClasses.inc}
17 PForm1 = ^TForm1;
18 TForm1 = object(TObj)
19 Form: PControl;
20 {$ELSE not_KOL_MCK}
21 TForm1 = class(TForm)
22 {$ENDIF KOL_MCK}
23 KOLProject1: TKOLProject;
24 KOLForm1: TKOLForm;
25 procedure KOLForm1FormCreate(Sender: PObj);
26 procedure KOLForm1Destroy(Sender: PObj);
27 procedure KOLForm1Paint(Sender: PControl; DC: HDC);
28 private
29 { Private declarations }
30 public
31 { Public declarations }
32 B: PBitmap;
33 end;
35 var
36 Form1 {$IFDEF KOL_MCK} : PForm1 {$ELSE} : TForm1 {$ENDIF} ;
38 {$R 'BMP1.RES'}
40 {$IFDEF KOL_MCK}
41 procedure NewForm1( var Result: PForm1; AParent: PControl );
42 {$ENDIF}
44 implementation
46 {$IFNDEF KOL_MCK} {$R *.DFM} {$ENDIF}
48 {$IFDEF KOL_MCK}
49 {$I MainPaintBitmap_1.inc}
50 {$ENDIF}
52 procedure TForm1.KOLForm1FormCreate(Sender: PObj);
53 begin
54 B := NewBitmap( 0, 0 );
55 B.LoadFromResourceName( hInstance, 'BMP1' );
56 end;
58 procedure TForm1.KOLForm1Destroy(Sender: PObj);
59 begin
60 B.Free;
61 end;
63 procedure TForm1.KOLForm1Paint(Sender: PControl; DC: HDC);
64 begin
65 B.Draw( DC, 0, 0 );
66 end;
68 end.