Update a Image

General TRichView support forum. Please post your questions here
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Post by Andy »

Please do not forget to solve the problem with pagebreak.
You tell me asap and I wait...


Andy
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Ilya is working on this problem (and a couple other bug reports).
As soon as it will be ready, I'll upload a fix.
wanderer
Posts: 3
Joined: Mon Nov 24, 2008 1:11 pm
Location: Ukraine
Contact:

Post by wanderer »

I have a problem with repainting of changed pictures in our version (1.9.42) of TRichView.

Here is the situation.
There are several threads that download web images and then update items in RVData (items receive temporary images until then).
When image is downloaded and saved to disk I use exactly the way you described to update it (SetPictureInfo, then Reformat). But there are no changes on RichView's canvas...

I just want to check with you whether such issue exists in that version of RichView or the problem is somewhere in our code...


UPD: Thought the "site" field from profile should be visible in forums - I'm one of the TimeMaker developers.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you call SetPictureInfo and Reformat in the context of the main process (using Synchronize)?
wanderer
Posts: 3
Joined: Mon Nov 24, 2008 1:11 pm
Location: Ukraine
Contact:

Post by wanderer »

It is protected by TMultiReadExclusiveWriteSynchronizer, that code is in write exclusive section.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I never used TMultiReadExclusiveWriteSynchronizer, but I am aftaid it's not enough. All methods for repainting (as well as methods for changing trichview content) should be executed in context of the main process, using Synchronize.
wanderer
Posts: 3
Joined: Mon Nov 24, 2008 1:11 pm
Location: Ukraine
Contact:

Post by wanderer »

It have to be enough, it is a "specialized" critical section which allows multi-threaded read access to memory but write is exclusive to the calling thread, to say so. Even VCL help lists critical section or this synchronizer as an alternative to using Synchronize method.

I tried to use Synchronize in case there may be some glitch in VCL itself but no - same effect.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I remember I created a demo with threaded downloading of images.
http://trichview.com/resources/html/rvh ... hreads.zip
May be it will be useful for you.
Post Reply