Print Page | Close Window

Pane redraw doubt!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=12287
Printed Date: 18 August 2022 at 1:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Pane redraw doubt!
Posted By: znakeeye
Subject: Pane redraw doubt!
Date Posted: 29 September 2008 at 12:32pm
I have a pane P1 with heavy GDI-drawing (memory-device + bitmap used). A hidden pane H1 is then shown. When I move away the mouse pointer it closes, but the content of H1 is visible for some 2 seconds!
 
Try this sample:
http://forum.codejock.com/uploads/20081002_172727_PaneRedrawProbl.zip - uploads/20081002_172727_PaneRedrawProbl.zip
 
You will see that only the obscured area of the right pane is invalidated, which is probably the best thing to do in most cases. However, why does this happen when CS_SAVEBITS is set for the window class?
 
I believe this is a flaw in the pane implementation!
 
 
From MSDN:
CS_SAVEBITS Saves, as a bitmap, the portion of the screen image obscured by a window of this class. When the window is removed, the system uses the saved bitmap to restore the screen image, including other windows that were obscured. Therefore, the system does not send WM_PAINT messages to windows that were obscured if the memory used by the bitmap has not been discarded and if other screen actions have not invalidated the stored image.



Replies:
Posted By: znakeeye
Date Posted: 02 October 2008 at 5:39pm
Interestingly... http://msdn.microsoft.com/en-us/library/bb983830.aspx - http://msdn.microsoft.com/en-us/library/bb983830.aspx


Posted By: Oleg
Date Posted: 03 October 2008 at 1:47am
Hi,
CS_SAVEBITS is style for Top Level windows only. Don't apply it for Child windows.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 03 October 2008 at 1:49am
btw... I very recommend use cashed bitmap if you need draw a lot of stuff.
 
See CXTPReportControl::OnPaint() method - if nothing was changed its just print saved m_bmpCache.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 03 October 2008 at 4:59am
I have a cached bitmap. The problem is I have to StretchBlt it...
 
Is there no other way to prevent the pane from being redrawn?


Posted By: Oleg
Date Posted: 06 October 2008 at 2:34am
your Pane is standard Window. Each window receives WM_PAINT if its content was invalidated.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 06 October 2008 at 12:04pm
CS_SAVEBITS is style for Top Level windows only.
 
Disagree. I think it should be possible to set this style of all panes, just like you do in MFC. Why not add this?
 
More info about this peculiar class style:
http://blogs.msdn.com/oldnewthing/archive/2006/04/28/586018.aspx - http://blogs.msdn.com/oldnewthing/archive/2006/04/28/586018.aspx


Posted By: Oleg
Date Posted: 07 October 2008 at 2:34am
Should be, but not possible. CS_SAVEBITS can't be applied for Child windows.
Use cashed bitmap and it will save time to redraw whole window.
 
 
Closed.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net