首页  编辑  

copyrect用法

Tags: /超级猛料/Picture.图形图像编程/控件和绘图/   Date Created:

]、。·ˉˇ¨〃々—~‖…’”〕〉》」』〗】∶!"'),.:;?]` unit Unit1;

interface

uses

 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

 PicShow, StdCtrls, ExtCtrls;

type

 TForm1 = class(TForm)

   Image1: TImage;

   Image2: TImage;

   Button1: TButton;

   procedure Button1Click(Sender: TObject);

 private

   { Private declarations }

 public

   { Public declarations }

//    th:tthreat;

 end;

var

 Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

const

step=4;

var

r:trect;

i:integer;

begin

image2.Canvas.FillRect(rect(0,0,image2.Width,image2.Height));

image2.Canvas.CopyMode:=cmsrccopy;

i:=0;

repeat

r:=rect(i,0,i+step,image1.Height);

sleep(10);

image2.Canvas.CopyRect(r,image1.Canvas,r);

application.ProcessMessages;

inc(i,step);

until i>image1.Width;

image2.Picture.Bitmap.SaveToFile('c:\windows\desktop\temp.bmp');

end;

end.

*********

object Form1: TForm1

 Left = 63

 Top = 57

 Width = 712

 Height = 453

 Caption = 'Form1'

 Color = clBtnFace

 Font.Charset = DEFAULT_CHARSET

 Font.Color = clWindowText

 Font.Height = -11

 Font.Name = 'MS Sans Serif'

 Font.Style = []

 OldCreateOrder = False

 PixelsPerInch = 96

 TextHeight = 13

 object Image1: TImage

   Left = 0

   Top = 0

   Width = 355

   Height = 426

   Align = alLeft

   Stretch = True

 end

 object Image2: TImage

   Left = 355

   Top = 0

   Width = 349

   Height = 426

   Align = alClient

 end

 object Button1: TButton

   Left = 328

   Top = 192

   Width = 75

   Height = 25

   Caption = 'Button1'

   TabOrder = 0

   OnClick = Button1Click

 end

end