home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / olympus / ik32_15t / delphi2.shr / UDRAW.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-08-01  |  1.3 KB  |  53 lines

  1. unit UDraw;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   OleCtrls, ImageKnife32, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Picbuf1: TPicbuf;
  12.     Button1: TButton;
  13.     procedure Button1Click(Sender: TObject);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   Form1: TForm1;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. procedure TForm1.Button1Click(Sender: TObject);
  28. var
  29.   scrdest : Variant;  { variable used for the screen destination }
  30. begin
  31.   TVarData(scrdest).VType := varSmallInt;
  32.   TVarData(scrdest).VSmallInt := 0; { Set Destination var to the DIB }
  33.   PicBuf1.Init(24,400,400,RGB(255,255,255));
  34.   PicBuf1.SelectTop := 150;
  35.   PicBuf1.SelectLeft := 150;
  36.   PicBuf1.SelectWidth := 400;
  37.   PicBuf1.SelectHeight := 400;
  38.   PicBuf1.ForeColor := RGB(255,0,0); { This color will be the pen color for Drawing }
  39.   PicBuf1.FontTransparent := True;
  40.   PicBuf1.Font.Size := 20;
  41.   PicBuf1.Text := 'Hello there';
  42.   { could also do a PicBuf1.OLEObject.TextDraw which }
  43.   { will default to drawing into the DIB }
  44.   PicBuf1.TextDraw(scrdest);
  45.  
  46.   PicBuf1.SelectTop := 0;
  47.   PicBuf1.SelectLeft := 0;
  48.   PicBuf1.ForeColor := RGB(0,255,0); { This color will be the pen color for Drawing }
  49.   PicBuf1.Arc(0,0,100,100, scrdest);
  50. end;
  51.  
  52. end.
  53.