写文章的时候 脑子有点乱
- unit uMainForm;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, GDIPOBJ,GDIPAPI,GDIPUTIL;
- type
- TForm1 = class(TForm)
- procedure FormCreate(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- public
- procedure DrawImage(Sender: TObject);
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- uses xDrawForm;
- var
- wwCanvas : TwwCanvas = nil;
- img_BackGround: TwwGDIImage= nil; // 背景图
- // img_ProgressBar1: TwwGDIImage= nil; // 上滚动条
- // img_ProgressBar2: TwwGDIImage= nil; // 下滚动条
- // img_Lighting: TwwGDIImage= nil; // 闪光点
- {$R *.dfm}
- procedure TForm1.DrawImage(Sender: TObject);
- begin
- TwwCanvas(Sender).wwDrawImage(img_BackGround);
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- DoubleBuffered := True;
- BorderStyle := bsNone;
- wwCanvas := TwwCanvas.Create();
- wwCanvas.InitCanvas(872,690);
- wwCanvas.OnDrawImage := Self.DrawImage;
- img_BackGround := TwwGDIImage.Create();
- img_BackGround.CreateImageNormal('BackGround.png',0,0,872,690);
- end;
- procedure TForm1.FormShow(Sender: TObject);
- begin
- wwCanvas.RePaint(Self.Handle);
- end;
- end.