Jump to content
lovromirnik

TImage and Picture

Recommended Posts

It works, but not the way you think. You have to assign a bitmap to it, like this:

 

type
 TForm1 = record
   Form1: TForm;
   Image1: TImage;
 end;

var
 Form1: TForm1;

procedure Form1_Init;
var
 Bmp: TSCARBitmap;
begin
 with Form1 do
 begin
   Form1 := CreateForm;
   Image1 := TImage.Create(Form1);
   with Form1 do
   begin
     Left := -1267;
     Top := 350;
     Caption := 'Form1';
     ClientHeight := 202;
     ClientWidth := 304;
     Color := clWindow;
     Font.Charset := DEFAULT_CHARSET;
     Font.Color := clWindowText;
     Font.Height := -11;
     Font.Name := 'Tahoma';
     Font.Style := [];
     OldCreateOrder := False;
     PixelsPerInch := 96;
   end;    
   with Image1 do
   begin
     Parent := Form1;
     Left := 12;
     Top := 12;
     Width := 136;
     Height := 88;
   end;  
 end;   
 Bmp := TSCARBitmap.Create('deNqNzd1Lk1EAx3H/BKGrboug7KIgIkaFJb2CR' +
   'jeaRC/2IshAIimyAomabE5DMXW1pW4uzW0+c3u2OTfdM5e6Nt1Lczo3ZSuczpQ' +
   'kfDlnS9H66Z03rsOPw7n4fDn7MjIzYt9/zMTn5hI/E/ML/zNIeFSBYKile7ZYu' +
   'CRnE9HYzB6Ts/PbTJ8IR6Kohpwjtyri/aOruNPOtsO8/jFUlj5O/DFwvWyy0/L' +
   'r754HAOxt6/iXIRcqjZbttXI5D12bW1u8SnpGSHOq6TkxPSukuXW0UELuN5Omf' +
   'iKzrwGAcQ4nPCq58jOjM528Yf2zufmoI/mCoVU9tNJIRUZajQdLhAZiGyeO0Bo' +
   'AmMnCwaOSSFvbO7VZuTqysXG3oVao57QeqvMkB0KU9VHGTc3fyMAE8UwTADBG3' +
   'wuPqr5RqmhXH7yoWV5fz+Ln8crv1LBWZ2QFXwxOEmeEOsPUG6WTsxQATK01wqO' +
   'qa/gg/6Q6cIFZSqUyr2XvL7hyuLiQ94RfUFVVKlNUqFixwa4YHLOHFgHAVIwBH' +
   'lWDpFnZwRy6bFqg9MjN2mNFEh6/7dIzbYGIK5H6nnfFRH2Lje6V5kAKAKyr2wy' +
   'PStaiVHXpj+Y5EoQcv/f+VElr9mPV1ZeGfKG96J23VB4p18y97vkt5pIAYHpTH' +
   'zyqtg5NmWD4RL6/pn0mvrq6xwDAnorcOkMvKjXDnr4dtbqWcaed1b3NzBYOldF' +
   'sfVUfOv9gQdA09dXt27WRXRNIpsHeNE1xjmFUNvug0+UZ9QY8vqDXn2YwkPA7l' +
   'dfnHx8LhoMTkeDEVLpFIOFR/QNUJI3K');         
 Bmp.AssignTo(Form1.Image1.Picture);
 Bmp.Free;
end;

procedure Form1_SafeInit;
var
 v: TVariantArray;
begin
 SetLength(v, 0);
 ThreadSafeCall('Form1_Init', v);
end;

function Form1_ShowModal: Boolean;
begin
 Result := Form1.Form1.ShowModal = mrOk;
end;

function Form1_SafeShowModal: Boolean;
var
 v: TVariantArray;
begin
 SetLength(v, 0);
 Result := ThreadSafeCall('Form1_ShowModal', v);
end;

begin
 Form1_SafeInit;
 Form1_SafeShowModal;
end.

Edited by Freddy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...