Dynamic Loading of JPG Images
Procedure tform1.button1click (Sender: tobject );
VaR
JPG: tsf-image; // use JPEG units
Begin
JPG: = tsf-image. Create;
JPG. loadfromfile ('d: \ 2.jpg ');
Image1.picture. bitmap. Assign (JPG); // because the IMG control is based on BMP
JPG. Free;
End;
// Formal general test in the project
Procedure tfrmbusline. formcreate (Sender: tobject );
VaR
Threadid: DWORD;
Dsroads: tdataset;
JPG: tsf-image;
Begin
// Initthread (Self );
JPG: = tsf-image. Create;
JPG. loadfromfile (extractfilepath (paramstr (0) + 'buslineback. jpg ');
Buslinelist: = thashedstringlist. Create;
Busroads: = thashedstringlist. Create;
Backimage: = timage. Create (NiL );
Backimage. Parent: = pnlbusline;
// Backimage. Picture. loadfromfile ();
Backimage. Picture. bitmap. Assign (JPG );
Backimage. autosize: = true;
Backimage. Width: = pnlbusline. width;
Backimage. Height: = pnlbusline. height;
End;