这样是双缓冲???
#include <GDIPlus.au3>
_Example()
Func _Example()
$hGui = GUICreate('')
GUISetBkColor(0xfbfcfd)
GUISetState()
Local $iW_Txt = 220, $iH_Txt = 55
_GDIPlus_Startup()
Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000);DD2200)
_GDIPlus_GraphicsTranslateTransform($hGraphic, $iW_Txt/2.5, $iW_Txt/1.5)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics(400, 400, $hGraphic)
; 绘制存储器区域(缓冲区)
$hBackBu_Graphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Local $hPath = _GDIPlus_PathCreate()
Local $hFamily = _GDIPlus_FontFamilyCreate("Arial");'宋体')
Local $tLayout = _GDIPlus_RectFCreate()
_GDIPlus_PathAddString($hPath,' 中国AU3论坛VIP认证章', $tLayout, $hFamily);'中中中中中'
Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath)
Local $hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, -$aBounds[0], -$aBounds[1])
_GDIPlus_MatrixScale($hMatrix, $iW_Txt / $aBounds[2], $iH_Txt / $aBounds[3], True)
_GDIPlus_PathTransform($hPath, $hMatrix)
; 在缓冲器绘制操作
_GDIPlus_GraphicsClear($hBackBu_Graphic, 0xFFFFFFFF)
_GDIPlus_GraphicsFillPath($hBackBu_Graphic, $hPath, $hBrush)
; 绘制屏幕
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
Do
Until GUIGetMsg() = -3
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_PathDispose($hPath)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackBu_Graphic)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>_Example
但还是不能解决更新控件不重绘 |