Page 1 of 1

TPrintPreview and GDI+

PostPosted: June 27th, 2011, 9:12 am
by mckiss
Hi Kambiz,

as far as I can see GDI+ patch works but it's not complete...

First of all as you can see here:

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

the output member of the GdiplusStartup function can be nil only if the SuppressBackgroundThread of the input parameter is false.
In your most recent gdi patch you set SuppressBackgroundThread to true but left output parameter to nil.

It seems to work but if you activate SYNOPSE define, it will hangs again as described in:

http://mikevdm.com/BlogEntry/Key/Gdiplu ... steriously

Synopse code infact sets correctly the output parameter.
I've tried to modify the TPrintPreview code to mimic the very same synopse behavior and all works great (the synopse code is quite different and requires further investigations and error handling, but it's a good starting point imho).

Re: TPrintPreview and GDI+

PostPosted: June 28th, 2011, 2:28 pm
by Kambiz
In releases before the current release, SuppressBackgroundThread was set to false. But it was causing problem in using TGdiPlusSubset in a dll.
http://www.delphiarea.com/articles/preview-v5_60/#comments

Seems neither SYNOPSE nor my code are correct.

Re: TPrintPreview and GDI+

PostPosted: June 28th, 2011, 5:36 pm
by Kambiz
Your second link was very helpful, thank you!
I hope the new release fixes all GDI+ related problems.

Re: TPrintPreview and GDI+

PostPosted: June 29th, 2011, 10:51 am
by mckiss
Thank you Kambiz, really, your work is gorgeous...