DonaldShimoda Posted June 19, 2018 Share Posted June 19, 2018 I need to update an image with a base64 string at runtime. The code "works" but the image dont refesh. function DecodeImageBase64(aString: String; Imagen: TUniImage): Boolean; function TdmMainCode.DecodeImageBase64; var lStream : TMemoryStream; aPicture : TPicture; begin if (aString = '') then begin Imagen.Hide; end else begin try lStream := TMemoryStream.Create; MimeDecode(aString, lStream); lStream.Position := 0; aPicture := TPicture.create; aPicture.LoadFromStream(lStream); Imagen.Picture.Assign(aPicture); Imagen.Hide; <<<--- desesperate try Imagen.Invalidate; <<<--- desesperate try Imagen.Show; finally lStream.Free; aPicture.Free; end; end; end; Hope somebody can helps. Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 19, 2018 Share Posted June 19, 2018 Hi, Maybe this post can help you: http://forums.unigui.com/index.php?/topic/6892-htmlframe-canvas-to-unimimage/&do=findComment&comment=35047 Best regards, Quote Link to comment Share on other sites More sharing options...
DonaldShimoda Posted June 19, 2018 Author Share Posted June 19, 2018 Thanks! My only concern is i must resize firefox to get it refreshed. Only one time, next times it just refresh ok. Quote Link to comment Share on other sites More sharing options...
DonaldShimoda Posted June 19, 2018 Author Share Posted June 19, 2018 Actually is a list of 10 images. Some of them need to be hiden, some updated. If dont touch anything the images are not refreshed on the navigator. If i resize just take update but the hidden images dont hide. Quote Link to comment Share on other sites More sharing options...
DonaldShimoda Posted June 19, 2018 Author Share Posted June 19, 2018 Ok, after all my test seems like the TuniImage objects dont works at all when Visible := False, or calling the Hide methof, or resizing via code, or anyelse. The only way to do is resize the navigator. Please let me know if is a bug or theres another way to fix this? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 20, 2018 Share Posted June 20, 2018 Can you make a simple testcase for better understanding? ... Quote Link to comment Share on other sites More sharing options...
DonaldShimoda Posted June 20, 2018 Author Share Posted June 20, 2018 Well, in my test case with a single image and a button it works. So, i have no idea what exactly is causing the problem and i cant send you teh complete app because it calls a own webservice from another server, requiring install... I'm scrubbing I dont know if is teh cause is the amount of images (10), the fact it happens inside a threaded timer, or because is inside a unigui panel... Now start the tedious path to find why this bug happens. Let you know if find any reason there Best regards. Quote Link to comment Share on other sites More sharing options...
DonaldShimoda Posted June 20, 2018 Author Share Posted June 20, 2018 Ok, i find the problem. I was using a UniThreadTimer. have logic, i bet that thread have no access to main thread and that cause the lack of update. Changin for standard uniTimer fix the problem. Solved now. Thanks for the support Quote Link to comment Share on other sites More sharing options...
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.