Watch, Follow, &
Connect with Us

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


ID: 16556, Use of SaveDC and RestoreDC with TCanvas

by Vadim Komine Email: Anonymous


The TCanvas class does not encapsulate the Windows GDI functions of SaveDC and RestoreDC that provide saving and restoring of the device context state.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For C++Builder, Version 3.0  to 6.0 844 downloads
Copyright: All rights reserved


Size: 2,546 bytes
Updated on Fri, 28 Feb 2003 05:02:44 GMT
Originally uploaded on Mon, 17 Sep 2001 05:45:38 GMT
SHA1 Hash: 6A59C85419718508EC011799EDFE80BC0D34DDBC
MD5 Hash: A8793C28069F4353D7A519ACB1EB5BB9

    Explore the files in this upload

Description
The TCanvas class does not encapsulate the Windows GDI functions of SaveDC and RestoreDC that provide saving and restoring of the device context state. However, use of these functions can be necessary for restoring the device context state, for example, if the clipping region of the device context varies with call of the IntersectClipRect function.

Problems
There are two problems at use of the SaveDC and RestoreDC functions with TCanvas.
The first problem consists in mismatch between the real state of the device context and the TCanvas state after call of RestoreDC.
The second problem is linked with Windows 9x. It does not work correctly if between call of SaveDC and RestoreDC the GDI objects (font, pen or brush) that have been selected into the device context before call of SaveDC are deleted. In this case in Windows 9x occurs the leakage of the GDI resources.

For more information, see http://www.mblabsoft.com

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Server Response from: ETNACDC03