Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.93 KB | None | 0 0
  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, Buttons, Unit1;
  8.  
  9. type
  10.   TForm2 = class(TForm)
  11.     edt1: TEdit;
  12.     edt2: TEdit;
  13.     lbl1: TLabel;
  14.     lbl2: TLabel;
  15.     btn1: TBitBtn;
  16.     procedure btn1Click(Sender: TObject);
  17.     procedure FormCreate(Sender: TObject);
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   Form2: TForm2;
  26.  
  27. implementation
  28.  
  29. {$R *.dfm}
  30.  
  31. procedure TForm2.btn1Click(Sender: TObject);
  32. begin
  33.  
  34.   Form2.Visible := false;
  35.   Form1.Img1.height := strtoint(form2.edt2.Text);
  36.   Form1.Img1.width := strtoint(form2.edt1.Text);
  37.   Form1.img1.Picture := nil;
  38.   Form1.img1.Canvas.FillRect(Form1.img1.Canvas.ClipRect);
  39. end;
  40.  
  41. procedure TForm2.FormCreate(Sender: TObject);
  42. begin
  43.   Form2.edt2.Text:=inttostr(Form1.Img1.height);
  44.   Form2.edt1.Text:=inttostr(Form1.Img1.width);
  45. end;
  46.  
  47. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement