unit MainUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtDlgs, StdCtrls, ExtCtrls, jpeg;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Button1: TButton;
    OpenPictureDialog1: TOpenPictureDialog;
    procedure Button1Click(Sender: TObject);
    procedure FormPaint(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
 if OpenPictureDialog1.Execute then
  Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
 Repaint;
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
 Canvas.BrushCopy(Rect(200,16,200+Image1.Width,16+Image1.Height),
             Image1.Picture.Bitmap,
             Rect(0,0,Image1.Width,Image1.Height),
             Image1.Picture.Bitmap.Canvas.Pixels[1,1]);
end;

end.
