Harry Rogers Posted April 21, 2016 Posted April 21, 2016 Hi I can't figure out how to use a UniNativeImageList as the picture source for a UniImage. I've tried all the obvious ( to me at least ) assignments without luck even resorting to this horror ! >> uniimage2.LoadFromStream(Tstream(uninativeimagelist1.Images[0].MemoryImage)); I'm sure it must be simple to do. Anyone care to enlighten me ? Many thanks Quote
Administrators Farshad Mohajeri Posted April 21, 2016 Administrators Posted April 21, 2016 Hi UniNativeImageList1.GetBitmap(0, UniImage1.Picture.Bitmap); This will be available in build 1295 which I will publish soon. Thanks Quote
BantuKumar Posted April 21, 2016 Posted April 21, 2016 Hi I can't figure out how to use a UniNativeImageList as the picture source for a UniImage. I've tried all the obvious ( to me at least ) assignments without luck even resorting to this horror ! >> uniimage2.LoadFromStream(Tstream(uninativeimagelist1.Images[0].MemoryImage)); I'm sure it must be simple to do. Anyone care to enlighten me ? Many thanks Hi, You can try as follow UniNativeImageList.GetBitmap(0, UniImage2.Picture.Bitmap); Best Regards, Quote
Harry Rogers Posted April 21, 2016 Author Posted April 21, 2016 Thanks Farshad I tried uninativeimagelist1.GetPng(0,tpngimage(uniimage0.Picture)); this gives the error 'Privileged instruction'. All the best Harry Quote
Administrators Farshad Mohajeri Posted April 21, 2016 Administrators Posted April 21, 2016 Normally you can't typecast Picture to PngImage unless it already holds a PNG image internally. You can try loading image into a temporary image then assign it to uniImage. Quote
Administrators Farshad Mohajeri Posted April 21, 2016 Administrators Posted April 21, 2016 var P : TPngImage; begin P := TPngImage.Create; try UniNativeImageList1.GetPng(0, P); UniImage1.Picture.Graphic.Assign(P); finally P.Free; end; Note: Requires build1295 Quote
Harry Rogers Posted April 21, 2016 Author Posted April 21, 2016 I've tried just about every combination I can think of up and down the object hierarchy but can't find a solution. I think I will pre-load the PNGs into a directory and simply use a loadfromfile in each case. would it be possible to add a property/method to the UniNativeImageList that returned a Tpicture or have a UnImage descendant that had imagelist & image index properties ? Many thanks Harry Quote
Administrators Farshad Mohajeri Posted April 21, 2016 Administrators Posted April 21, 2016 Build 1295 is being uploaded. Please try my suggested solution with it. Quote
Harry Rogers Posted April 21, 2016 Author Posted April 21, 2016 Thats working fine now, as per your example with 1295. Reported - fixed - built - Uploaded - Downloaded - built - tested < Two and Half Hours>. That's a pretty amazing service. Thank you Quote
Administrators Farshad Mohajeri Posted April 22, 2016 Administrators Posted April 22, 2016 Thanks I wish we could bring resolutions to all issues as fast as this. Some issues may wait for months before we can find some workaround or solution. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.