home *** CD-ROM | disk | FTP | other *** search
- unit UDraw;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- OleCtrls, ImageKnife32, StdCtrls;
-
- type
- TForm1 = class(TForm)
- Picbuf1: TPicbuf;
- Button1: TButton;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- scrdest : Variant; { variable used for the screen destination }
- begin
- TVarData(scrdest).VType := varSmallInt;
- TVarData(scrdest).VSmallInt := 0; { Set Destination var to the DIB }
- PicBuf1.Init(24,400,400,RGB(255,255,255));
- PicBuf1.SelectTop := 150;
- PicBuf1.SelectLeft := 150;
- PicBuf1.SelectWidth := 400;
- PicBuf1.SelectHeight := 400;
- PicBuf1.ForeColor := RGB(255,0,0); { This color will be the pen color for Drawing }
- PicBuf1.FontTransparent := True;
- PicBuf1.Font.Size := 20;
- PicBuf1.Text := 'Hello there';
- { could also do a PicBuf1.OLEObject.TextDraw which }
- { will default to drawing into the DIB }
- PicBuf1.TextDraw(scrdest);
-
- PicBuf1.SelectTop := 0;
- PicBuf1.SelectLeft := 0;
- PicBuf1.ForeColor := RGB(0,255,0); { This color will be the pen color for Drawing }
- PicBuf1.Arc(0,0,100,100, scrdest);
- end;
-
- end.
-