Extremely slow refresh and resize

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Extremely slow refresh and resize

Postby allancass » August 3rd, 2012, 8:02 am

Hello
when using XPTheme.pas from http://www.jrsoftware.org/misc.php
the paint gets extremely slow.
As far as I see the issue is in:
procedure TPrintPreview.DrawPage(PageNo: Integer; Canvas: TCanvas;

gdiPlus.Draw(Canvas, Rect, FPageList[PageNo-1])

this method gets extremely slow.
What could be the cause? Can you suggest a workaround?
allancass
Active Member
Active Member
 
Posts: 6
Joined: August 3rd, 2012, 7:58 am

Re: Extremely slow refresh and resize

Postby allancass » August 3rd, 2012, 8:40 am

Same happens if you set the alpha blending of the form ON.
allancass
Active Member
Active Member
 
Posts: 6
Joined: August 3rd, 2012, 7:58 am

Re: Extremely slow refresh and resize

Postby allancass » August 5th, 2012, 6:19 pm

I analyzed this in depth.
Nice component, unfortunately the paint implementation is extremely bad.

The thumbnails paint should be completely redesigned as the stretchdraw is SO SLOW.
The thumbnails should be buffered in a stretched state and updated only when the preview is resized or the document edited.

Please set the alphablend property of the form to true to see what I am talking about.

I did some experiments, but the paint of the thumbnails preview requires a complete redesign.
allancass
Active Member
Active Member
 
Posts: 6
Joined: August 3rd, 2012, 7:58 am

Re: Extremely slow refresh and resize

Postby Kambiz » August 5th, 2012, 7:21 pm

This old component using the old fashion GUI libraries. I agree with you that this component (as well as my other old components) should totally be re-designed, but lack of interest is a prevention.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: Extremely slow refresh and resize

Postby allancass » August 5th, 2012, 11:36 pm

Thank you for your reply and for providing this component for free.
Do you have some time to test this case?

Generally your component seems to be the best out there and if you can take a look at this issue I will be glad to use it.

I invested quite some time in it, but I did not find an easy way to optimize it. It also has issue if doublebuffered flag is set to true.
The slowest part is TThumbnailPreview. Maybe you can find an easier workaround in order to make it work a little bit better with XPtheme.

The only thing you need to do is download XPTheme.pas from http://www.jrsoftware.org/misc.php extract it in General demo and add it in the uses list in General.

I made an implementation of TPageSetupDialog for D6 that works with your code. I will send you the code if you like to include it - please send me your e-mail in PM.

Thank you in advance.
allancass
Active Member
Active Member
 
Posts: 6
Joined: August 3rd, 2012, 7:58 am

Re: Extremely slow refresh and resize

Postby Kambiz » August 6th, 2012, 8:37 pm

I already tried to optimize rendering of the controls as much as my knowledge allowed. The controls only paint the regions that need to be updated, and the off screen rendering is already in use. Actually by setting DubbleBuffered property to true, you reduce the performance without anything being gained.

Which version of Delphi you use? Delphi 7 and higher do not need a third party component for XP theme. If you are using XPTheme of Jordan with the wrong version of Delphi, that could be the source of the problem.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: Extremely slow refresh and resize

Postby allancass » August 7th, 2012, 6:46 am

I am using D6.
As I wrote even if I disable the use of XPTheme and set the form transparent I get the same slow performance.
I suspect that XPTheme somehow sets the same flags causing your GDI functions to create a transparent canvas without need thus compromising performance.
allancass
Active Member
Active Member
 
Posts: 6
Joined: August 3rd, 2012, 7:58 am

Re: Extremely slow refresh and resize

Postby allancass » August 8th, 2012, 2:06 pm

This issue is not related to Delphi version - tested on D7 and newer too.
allancass
Active Member
Active Member
 
Posts: 6
Joined: August 3rd, 2012, 7:58 am

Re: Extremely slow refresh and resize

Postby Kambiz » August 19th, 2012, 2:40 pm

Finally today I had time to test PrintPreview on semi-transparent forms. I didn't see any performance issue.

As I said before, the problem is perhaps because of the third party XPTheme support.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 10 guests

cron