Sets the compositing quality of a Graphics object
#include <GDIPlus.au3>
_GDIPlus_GraphicsSetCompositingQuality ( $hGraphics, $iCompositionQuality )
$hGraphics | Pointer to a Graphics object |
$iCompositionQuality | Compositing quality: $GDIP_COMPOSITINGQUALITY_DEFAULT (0) - Gamma correction is not applied. $GDIP_COMPOSITINGQUALITY_HIGHSPEED (1) - Gamma correction is not applied. High speed, low quality. $GDIP_COMPOSITINGQUALITY_HIGHQUALITY (2) - Gamma correction is applied. Composition of high quality and speed. $GDIP_COMPOSITINGQUALITY_GAMMACORRECTED (3) - Gamma correction is applied. $GDIP_COMPOSITINGQUALITY_ASSUMELINEAR (4) - Gamma correction is not applied. Linear values are used. |
Success: | True. |
Failure: | False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3). |
_GDIPlus_GraphicsGetCompositingQuality
Search GdipSetCompositingQuality in MSDN Library.
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $hGUI, $hGraphic, $hBrush, $iQuality1, $iQuality2, $hMatrix
; Create GUI
$hGUI = GUICreate("GDI+", 800, 400)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
_GDIPlus_GraphicsClear($hGraphic, 0xFF6600AA)
Local $hPath = _GDIPlus_PathCreate()
_GDIPlus_PathAddEllipse($hPath, 10, 10, 380, 360)
$hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
_GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF)
_GDIPlus_PathBrushSetSurroundColor($hBrush, 0)
_GDIPlus_PathBrushSetSigmaBlend($hBrush, 1)
_GDIPlus_PathBrushSetFocusScales($hBrush, 0.7, 0.7)
_GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush)
$iQuality1 = _GDIPlus_GraphicsGetCompositingQuality($hGraphic)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iQuality1 = ' & $iQuality1 & @CRLF & '>Error code: ' & @error & ' Extended code: ' & @extended & ' (0x' & Hex(@extended) & ')' & @CRLF) ;### Debug Console
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, 400, 0)
_GDIPlus_PathTransform($hPath, $hMatrix)
_GDIPlus_PathBrushSetTransform($hBrush, $hMatrix)
Local $iRet = _GDIPlus_GraphicsSetCompositingQuality($hGraphic, $GDIP_COMPOSITINGQUALITY_GAMMACORRECTED)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iRet = ' & $iRet & @CRLF & '>Error code: ' & @error & ' Extended code: ' & @extended & ' (0x' & Hex(@extended) & ')' & @CRLF) ;### Debug Console
_GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush)
$iQuality2 = _GDIPlus_GraphicsGetCompositingQuality($hGraphic)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iQuality2 = ' & $iQuality2 & @CRLF & '>Error code: ' & @error & ' Extended code: ' & @extended & ' (0x' & Hex(@extended) & ')' & @CRLF) ;### Debug Console
_GDIPlus_GraphicsDrawString($hGraphic, "CompositingQuality = " & $iQuality1, 10, 380)
_GDIPlus_GraphicsDrawString($hGraphic, "CompositingQuality = " & $iQuality2, 420, 380)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_PathDispose($hPath)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>Example