![]() |
|
#1
|
|||
|
|||
|
i made a resource file
jpegs.res _______________ jpg1 jpeg 1.jpg jpg2 jpeg 2.jpg jpg3 jpeg 3.jpg jpg4 jpeg 4.jpg _______________ how to read them to a TIamge? ~3homer~ Thanx,very much. |
|
#2
|
|||
|
|||
|
I have done it this way on my application. I use .bmp picture format.
begin img1.Picture.Bitmap.LoadFromResourceName(hInstance , 'LOGO'); end; img1 is name of the TImage-component. Resource file (.rc file) looks like this: And of course I have compiled .rc file to .res file. This works just great to me! - JJe |
|
#3
|
|||
|
|||
|
It works this way only for BMP resources, however for JPEG ones it needs a little bit more work.
var r: TStream; i: TJpegImage; begin r:=NIL; i:=NIL; try r:=TResourceStream.Create(hinstance, 'JPEG1', rt_rcdata); i:=TJpegImage.Create; i.loadfromstream(r); image1.picture.assign(i); finally r.free; i.free; end; end; Bye, Andy If it helped please click accept... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|