Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Using Tbitmap in thread not work under android :(


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Dec 15, 2015 3:36 PM Last Post By: loki loki
loki loki

Posts: 787
Registered: 7/1/02
Using Tbitmap in thread not work under android :(  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 13, 2015 1:40 PM
Hello,

I can not use Tbitmap inside a thread under Android why ?
i have error like "Size too big" for exemple.

But in the main thread it's work very good ! what's the problem ? and what the workaround ?

thanks by advance
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Using Tbitmap in thread not work under android :(  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 13, 2015 2:31 PM   in response to: loki loki in response to: loki loki
loki wrote;

I can not use Tbitmap inside a thread under Android why ? i have error
like "Size too big" for exemple.

FireMonkey's TBitmap has had problems with threading on Android for a LONG
time (since at least XE5). After several releases and patch updates, it
still has problems. For example:

TBitmap.CreateFromStream Not Working in XE8
https://quality.embarcadero.com/browse/RSP-11063

The long and short is that TBitmap is simply not thread-safe so don't use
it outside the context of the main UI thread. If you need to work with bitmaps
in a thread, you will have to find another solution.

--
Remy Lebeau (TeamB)
loki loki

Posts: 787
Registered: 7/1/02
Re: Using Tbitmap in thread not work under android :(  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 13, 2015 4:42 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
The long and short is that TBitmap is simply not thread-safe so don't use
it outside the context of the main UI thread. If you need to work with bitmaps
in a thread, you will have to find another solution.

thanks remy

:( in seattle 10 upd1 it's still not working :(

unfortunatly their is not other solution than using Tbitmap,
I was thinking to use TbitmapSurface but Tbitmap surface doesn't have any canvas :( and i need a canvas to do FillText :(

it's a big problem that bitmap are not threadsafe :(
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Using Tbitmap in thread not work under android :(  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 15, 2015 9:08 AM   in response to: loki loki in response to: loki loki
loki loki

Posts: 787
Registered: 7/1/02
Re: Using Tbitmap in thread not work under android :(  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 15, 2015 3:36 PM   in response to: Eli M in response to: Eli M
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02