Export (0) Print
Expand All
Expand Minimize

Graphics.GetCompositingQuality method

Applies to: desktop apps only

The Graphics::GetCompositingQuality method gets the compositing quality currently set for this Graphics object.

Syntax

CompositingQuality GetCompositingQuality();

Parameters

This method has no parameters.

Return value

Type:

Type: CompositingQuality

This method returns an element of the CompositingQuality enumeration that indicates the compositing quality currently set for this Graphics object.

Examples

The following example creates a Graphics object and sets its compositing quality to CompositingQualityHighQuality. The code creates a SolidBrush object based on a color with an alpha component of 128. The code passes the address of that brush to the Graphics::FillRectangle method of the Graphics object. The call to the Graphics::GetCompositingQuality method of the Graphics object demonstrates how to obtain the compositing quality (which is already known in this case). The code determines whether the compositing quality is CompositingQualityHighQuality and if so, changes it to CompositingQualityHighSpeed. Then the code calls the Graphics::FillRectangle method a second time. The second rectangle is filled with the same brush that was used to fill the first rectangle, but the result is different because of the compositing quality setting.


VOID Example_GetCompositingQuality(HDC hdc)
{
   Graphics graphics(hdc);
   
   // Set the compositing quality.
   graphics.SetCompositingQuality(CompositingQualityHighQuality);
   SolidBrush alphaBrush(Color(128, 255, 0, 0));
   graphics.FillRectangle(&alphaBrush, 0, 0, 100, 100);
   
   // Get the compositing quality.
   CompositingQuality compQuality = graphics.GetCompositingQuality();
   
   // Change the compositing mode if it is CompositingModeSourceCopy.
   if (compQuality == CompositingQualityHighQuality)
   {
      graphics.SetCompositingQuality(CompositingQualityHighSpeed);
   }  
   
   graphics.FillRectangle(&alphaBrush, 0, 100, 100, 100);
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Graphics::GetCompositingQuality
HatchBrush
Graphics::SetCompositingMode
Graphics::SetCompositingQuality
SolidBrush
Alpha Blending Lines and Fills
New Features

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft