Click to See Complete Forum and Search --> : Does GDI+ retain the device context attributes..


pradish
December 12th, 2005, 06:30 AM
Hi all


my appliation program uses lots of GDI
code, like setting the MappingMode, window and
viewport orgins and Transformations.

Now for smoothing the lines drawn by GDI, i use
the GDI+, by creating a graphics object.

Graphics graphics(_device_context);

By doing this, will it affect the mapping mode and
other attributes of device context which i have set
earlier.


can anyone clarify my doubt.

if yes then how do we set MM_HIMETRIC Mapping mode in
GDI+.

thanks and regards
pradish

Marc G
December 12th, 2005, 09:48 AM
[ moved thread ]

olivthill
December 12th, 2005, 11:07 AM
Yes, the map mode, the style of the pen, of the brush, etc, are associated with the device context, until the device context is released or until other associations are done. Personnaly, I set the map mode, using GDI, with :
int MapModePrevious;
MapModePrevious = SetMapMode(hdc, MM_HIMETRIC);
...
... code for drawing into or reading from the device context
...
SetMapMode(hdc, MapModePrevious);