返回列表 发帖

图片测试

附件: 您需要登录才可以下载或查看附件。没有帐号?加入
转身离开
分手说不出来
海鸟跟鱼相爱
只是一场意外
我们的爱差异一直存在
风中尘埃竟累积成伤害

附件: 您需要登录才可以下载或查看附件。没有帐号?加入
转身离开
分手说不出来
海鸟跟鱼相爱
只是一场意外
我们的爱差异一直存在
风中尘埃竟累积成伤害

TOP

附件: 您需要登录才可以下载或查看附件。没有帐号?加入
转身离开
分手说不出来
海鸟跟鱼相爱
只是一场意外
我们的爱差异一直存在
风中尘埃竟累积成伤害

TOP

chrome测试
附件: 您需要登录才可以下载或查看附件。没有帐号?加入
自己知道的,尽量告诉别人,自己不知道的,虚心学习

TOP

  1. #include <GDIPlus.au3>

  2. Opt("GUIOnEventMode", 1)

  3. Global $hGUI, $hGraphic, $hBitmap, $hBackbuffer
  4. Global $aGUIDIm[2] = [710, 300]
  5. Global $aGraphicsRect[4] = [0, 0, 800, 300]

  6. Global $aCircleRect[4] = [50, 50, 200, 200]
  7. Global $aSinusRect[4] = [300, 50, 360, 200]
  8. Global $aBrushes[10], $aPens[10]

  9. Global $fPi = 3.14159265358979
  10. Global $fDegToRad = $fPi / 180
  11. Global $nPhi = 0

  12. Global $iFrequency = 1, $iAmplitude = $aSinusRect[3] / 2, $iPhase = 0, $iLength = 380

  13. $hGUI = GUICreate("正弦函数演示", $aGUIDIm[0], $aGUIDIm[1], -1, -1)
  14. GUISetOnEvent(-3, "_Exit")

  15. GUICtrlCreateGraphic($aGraphicsRect[0], $aGraphicsRect[1], $aGraphicsRect[2], $aGraphicsRect[3])
  16. $hGraphic = GUICtrlGetHandle(-1)

  17. GUISetState()

  18. _Startup()

  19. While 1
  20.         Sleep(10)
  21.         _Draw()
  22.         $nPhi += 0.5
  23. WEnd

  24. Func _Draw()
  25.         _GDIPlus_GraphicsFillRect($hBackbuffer, 0, 0, $aGraphicsRect[2], $aGraphicsRect[3], $aBrushes[0])
  26.         _GDIPlus_GraphicsDrawRect($hBackbuffer, 0, 0, $aGraphicsRect[2] - 1, $aGraphicsRect[3] - 1)

  27.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aCircleRect[0], $aCircleRect[1] + ($aCircleRect[3] / 2), $aCircleRect[0] + $aCircleRect[2], $aCircleRect[1] + ($aCircleRect[3] / 2))
  28.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aCircleRect[0] + ($aCircleRect[2] / 2), $aCircleRect[1], $aCircleRect[0] + ($aCircleRect[2] / 2), $aCircleRect[1] + $aCircleRect[3])

  29.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aCircleRect[0] + ($aCircleRect[2] / 2), _
  30.                         $aCircleRect[1] + ($aCircleRect[3] / 2), _
  31.                         $aCircleRect[0] + ($aCircleRect[2] / 2) + (Cos($nPhi * $fDegToRad) * $iAmplitude), _
  32.                         $aCircleRect[1] + ($aCircleRect[3] / 2) - (Sin($nPhi * $fDegToRad) * $iAmplitude))

  33.         _GDIPlus_GraphicsDrawArc($hBackbuffer, $aCircleRect[0] + ($aCircleRect[2] / 2) - 20, $aCircleRect[1] + ($aCircleRect[3] / 2) - 20, 40, 40, 0, -Mod($nPhi, 360), $aPens[3])

  34.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aCircleRect[0] + ($aCircleRect[2] / 2) + (Cos($nPhi * $fDegToRad) * $iAmplitude), _
  35.                         $aCircleRect[1] + ($aCircleRect[3] / 2) - (Sin($nPhi * $fDegToRad) * $iAmplitude), _
  36.                         $aCircleRect[0] + ($aCircleRect[2] / 2) + (Cos($nPhi * $fDegToRad) * $iAmplitude), _
  37.                         $aCircleRect[1] + ($aCircleRect[3] / 2), $aPens[2])

  38.         _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $aCircleRect[0], $aCircleRect[1], $aCircleRect[2], $aCircleRect[3], $aPens[1])

  39.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aCircleRect[0] + ($aCircleRect[2] / 2) + (Cos($nPhi * $fDegToRad) * $iAmplitude), _
  40.                         $aCircleRect[1] + ($aCircleRect[3] / 2) - (Sin($nPhi * $fDegToRad) * $iAmplitude), _
  41.                         $aSinusRect[0] + Mod($nPhi, 360) * $iFrequency, _
  42.                         $aSinusRect[1] + ($aSinusRect[3] / 2) - (Sin($nPhi * $fDegToRad) * $iAmplitude))

  43.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aSinusRect[0] + Mod($nPhi, 360) * $iFrequency, _
  44.                         $aSinusRect[1] + ($aSinusRect[3] / 2) - (Sin($nPhi * $fDegToRad) * $iAmplitude), _
  45.                         $aSinusRect[0] + Mod($nPhi, 360) * $iFrequency, _
  46.                         $aSinusRect[1] + ($aSinusRect[3] / 2), $aPens[2])

  47.         _GDIPlus_GraphicsDrawLine($hBackbuffer, $aSinusRect[0], $aSinusRect[1] + $iAmplitude, $aSinusRect[0] + $aSinusRect[2], $aSinusRect[1] + $iAmplitude)
  48.         For $i = 0 To Int($aSinusRect[2] / (90 / $iFrequency))
  49.                 _GDIPlus_GraphicsDrawLine($hBackbuffer, $aSinusRect[0] + (90 / $iFrequency) * $i, $aSinusRect[1] - 10, $aSinusRect[0] + (90 / $iFrequency) * $i, $aSinusRect[1] + $aSinusRect[3] + 10, $aPens[0])
  50.         Next
  51.         _GDIPlus_GraphicsDrawSinus($hBackbuffer, $aSinusRect[0], $aSinusRect[1], $aSinusRect[2], $iFrequency, $iAmplitude, $iPhase, $aPens[1])

  52.         _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
  53. EndFunc   ;==>_Draw

  54. Func _Startup()
  55.         _GDIPlus_Startup()
  56.         $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGraphic)
  57.         _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
  58.         $hBitmap = _GDIPlus_BitmapCreateFromGraphics($aGraphicsRect[2], $aGraphicsRect[3], $hGraphic)
  59.         $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
  60.         _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

  61.         $aBrushes[0] = _GDIPlus_BrushCreateSolid(0xFFEEEEEE)
  62.         $aPens[0] = _GDIPlus_PenCreate(0xFF000000)
  63.         _GDIPlus_PenSetDashStyle($aPens[0], $GDIP_DASHSTYLEDASH)
  64.         $aPens[1] = _GDIPlus_PenCreate(0xFF0000FF, 2)
  65.         $aPens[2] = _GDIPlus_PenCreate(0xFFFF0000, 2)
  66.         $aPens[3] = _GDIPlus_PenCreate(0xFF00AA00, 2)
  67. EndFunc   ;==>_Startup

  68. Func _Exit()
  69.         For $i = 0 To UBound($aBrushes) - 1
  70.                 _GDIPlus_BrushDispose($aBrushes[$i])
  71.         Next
  72.         For $i = 0 To UBound($aPens) - 1
  73.                 _GDIPlus_PenDispose($aPens[$i])
  74.         Next
  75.         _GDIPlus_GraphicsDispose($hBackbuffer)
  76.         _GDIPlus_BitmapDispose($hBitmap)
  77.         _GDIPlus_GraphicsDispose($hGraphic)
  78.         _GDIPlus_Shutdown()
  79.         Exit
  80. EndFunc   ;==>_Exit

  81. Func _GDIPlus_GraphicsDrawSinus($hGraphic, $iX, $iY, $iLength, $iFrequency, $iAmplitude, $iPhase, $hPen = 0)
  82.         Local $fPi = 3.14159265358979
  83.         Local $fDegToRad = $fPi / 180
  84.         Local $iPointCount = $iLength * $iFrequency
  85.         Local $aPoints[$iPointCount + 1][2] = [[$iPointCount]]

  86.         For $i = 0 To $iPointCount - 1
  87.                 $aPoints[$i + 1][0] = $iX + ($i / $iFrequency)
  88.                 $aPoints[$i + 1][1] = $iY + $iAmplitude - (Sin(($i + $iPhase) * $fDegToRad) * $iAmplitude)
  89.         Next
  90.         _GDIPlus_GraphicsDrawCurve($hGraphic, $aPoints, $hPen)
  91. EndFunc   ;==>_GDIPlus_GraphicsDrawSinus

  92. Func _GDIPlus_GraphicsDrawCosinus($hGraphic, $iX, $iY, $iLength, $iFrequency, $iAmplitude, $iPhase, $hPen = 0)
  93.         Local $fPi = 3.14159265358979
  94.         Local $fDegToRad = $fPi / 180
  95.         Local $iPointCount = $iLength * $iFrequency
  96.         Local $aPoints[$iPointCount + 1][2] = [[$iPointCount]]

  97.         For $i = 0 To $iPointCount - 1
  98.                 $aPoints[$i + 1][0] = $iX + ($i / $iFrequency)
  99.                 $aPoints[$i + 1][1] = $iY + $iAmplitude + (Cos(($i + $iPhase) * $iPointCount) * $iAmplitude)
  100.         Next
  101.         _GDIPlus_GraphicsDrawCurve($hGraphic, $aPoints, $hPen)
  102. EndFunc   ;==>_GDIPlus_GraphicsDrawCosinus
复制代码
自己知道的,尽量告诉别人,自己不知道的,虚心学习

TOP

chrome浏览器,一直在用的,版本79.0.3945.88 版本是64位的,测试没问题。
1

评分人数

自己知道的,尽量告诉别人,自己不知道的,虚心学习

TOP

回复 6# lpxx


    帅!

TOP

回复 5# lpxx


    可以用  au3 标签。
  1. #include <GDIPlus.au3>

  2. Opt("GUIOnEventMode", 1)

复制代码 高亮切换

TOP

回复 3# haijie1223

P得他妈都不认识了...
海盗博客:www.hidao.org

TOP

返回列表