CGpGraphics.GetCompositingQualitymethod
Gets the compositing quality currently set for this **Graphics** object.
Syntax
FUNCTION GetCompositingQuality () AS CompositingQuality
Return value
This method returns an element of the CompositingQuality enumeration that indicates the compositing quality currently set for this Graphics object.
Description
Gets 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.CompositingQuality ' 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. ' ======================================================================================== SUB Example_CompositingQuality (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
graphics.SetCompositingQuality(CompositingQualityHighQuality) DIM alphaBrush AS CGpSolidBrush = GDIP_ARGB(128, 255, 0, 0) graphics.FillRectangle(@alphaBrush, 0, 0, 100, 100)
' // Get the compositing mode. DIM compQuality AS CompositingMode compQuality = graphics.GetCompositingQuality
' // Change the compositing quality if it is CompositingQualityHighQuality IF compQuality = CompositingQualityHighQuality THEN
graphics.SetCompositingQuality(CompositingQualityHighSpeed)
END IF
graphics.FillRectangle(@alphaBrush, 0, 100, 100, 100)
END SUB ' ========================================================================================
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 FillRectangle method of the Graphics object. The call to the 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 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.
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:171
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class