Authenticity Posted December 11, 2009 Author Share Posted December 11, 2009 (edited) Here are a few image convolution methods written using Christian Graus's source and examples over here, thanks . Need to rewrite the DLL file.Edit: 21.07.2010Rewrote the function in assembly so it doesn't require the DLL file anymore.Instead, you need to download Fasm written by Ward.Thanks Ward <3Example:#include "Convolution.au3" #include <ScreenCapture.au3> _GDIPlus_Startup() Local $hBmp, $hBitmap, $hEmboss $hBmp = _ScreenCapture_Capture("", 0, 0, -1, -1, False) $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) _WinAPI_DeleteObject($hBmp) $hEmboss = _Image_Emboss($hBitmap, $VertOnly) If $hEmboss Then _GDIPlus_ImageSaveToFile($hEmboss, @ScriptDir & "\VertEmbossed.png") _GDIPlus_ImageDispose($hEmboss) ShellExecute(@ScriptDir & "\VertEmbossed.png") EndIf _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown()For each of the filter functions, you can supply counter value. The counter value specifies how many times to execute the convolution matrix against the image.Convolution.au3 Edited July 21, 2010 by Authenticity Link to comment Share on other sites More sharing options...
trancexx Posted December 11, 2009 Share Posted December 11, 2009 Just to say that I tried that script on XP couple of minutes ago before switching to Vista and it wasn't working there (as some other examples). Could you add some message box or something to show when failure happen, at least when you expect one for some systems. That's expected? Vista is just fine of course. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Authenticity Posted December 11, 2009 Author Share Posted December 11, 2009 I have no XP to test with, all the examples are tested on Vista as you've noticed. Can you point the scripts the don't work? Thanks for testing. Link to comment Share on other sites More sharing options...
trancexx Posted December 11, 2009 Share Posted December 11, 2009 Sure, when I'm back on XP. Massive work, I must say. So, did you lose weight writing it? Had to be exhausting. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Authenticity Posted December 11, 2009 Author Share Posted December 11, 2009 lol I can say that the c v and ctrl keys are more damaged. Link to comment Share on other sites More sharing options...
trancexx Posted December 12, 2009 Share Posted December 12, 2009 Short report from XP.Confusion with new BETA (strange, strange):_GDIPlus_GraphicsFillRectangles.au3_GDIPlus_GraphicsFillRegion.au3_GDIPlus_GraphicsFillPolygon2.au3_GDIPlus_GraphicsFillPath.au3_GDIPlus_GraphicsFillClosedCurve2.au3_GDIPlus_GraphicsDrawRectangles.au3_GDIPlus_GraphicsDrawPath.au3_GDIPlus_GraphicsDrawLines.au3_GDIPlus_GraphicsDrawCurve3.au3_GDIPlus_GraphicsDrawCurve2.au3_GDIPlus_GraphicsDrawClosedCurve2.au3_GDIPlus_GraphicsDrawBeziers.au3_GDIPlus_CustomLineCapSetWidthScale.au3_GDIPlus_CustomLineCapSetStrokeJoin.au3_GDIPlus_CustomLineCapSetStrokeCaps.au3_GDIPlus_CustomLineCapSetBaseInset.au3_GDIPlus_CustomLineCapSetBaseCap.au3_GDIPlus_CustomLineCapGetWidthScale.au3_GDIPlus_CustomLineCapGetStrokeJoin.au3_GDIPlus_CustomLineCapGetStrokeCaps.au3_GDIPlus_CustomLineCapGetBaseInset.au3_GDIPlus_CustomLineCapGetBaseCap.au3_GDIPlus_CustomLineCapCreate.au3_GDIPlus_CustomLineCapClone.au3_GDIPlus_BitmapCreateFromScan0.au3Not working:_GDIPlus_BitmapCreateFromResource.au3 - no such resource on XP_GDIPlus_BitmapCreateFromStream.au3_GDIPlus_BitmapCreateFromGdiDib.au3That's it. Didn't try to find the cause so there is a possibility it's just me. Will see if someone else reports the same. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Yashied Posted December 27, 2009 Share Posted December 27, 2009 (edited) Powerful stuff, your UDF has exceeded the size of my WinAPIEx.au3. You did a great job.One remark. Functions like _GDIPlus_BitmapSetPixel() may crash the script, if pixel coordinates are outside the image. I found this in my 3D Axis program. Maybe better to check the coordinates of pixel before calling the DllCall()?Thanks.PS from me for a really professional job. Edited December 27, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Michel Claveau Posted December 28, 2009 Share Posted December 28, 2009 (edited) Hi! Examples run, on my computer, only if I replace several function's names par '_'+function's name: _GDIPlus_PenDefCreate by __GDIPlus_PenDefCreate _GDIPlus_PenDefDispose by __GDIPlus_PenDefDispose _GDIPlus_BrushDefCreate by __GDIPlus_BrushDefCreate _GDIPlus_BrushDefDispose by __GDIPlus_BrushDefDispose is it normal? (I use autoit 3.3.2.0 and Windows 7-32) And also, the path for GdiPlus.dll is different (%windir%\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.7600.16385_none_83ab0ddaed0c4c23) Edited December 28, 2009 by Michel Claveau Link to comment Share on other sites More sharing options...
Authenticity Posted December 28, 2009 Author Share Posted December 28, 2009 Yes, it's normal. I've put the AutoIt version and a short description about GDI+ in GDIP.au3 at the header. I'll fix it when I get time. Link to comment Share on other sites More sharing options...
eukalyptus Posted March 26, 2010 Share Posted March 26, 2010 (edited) Hi!THX for this great UDF!I found a bug in _GDIPlus_PathWarp: If $iCount <> 3 Or $iCount <> 4 Thenhas to be changed to: If $iCount <> 3 And $iCount <> 4 Then Edited March 26, 2010 by eukalyptus DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
ProgAndy Posted December 9, 2010 Share Posted December 9, 2010 Thx for the UDF, but I have a request. Could you please remove the _WinAPI_...-functions from it? I'd like to use this UDF together with WinApiEx and the functions are already defined there. In my opinion, this GDIp.au3 should only contain _GDIPlus_... functions and not WinApi. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
monoscout999 Posted September 6, 2011 Share Posted September 6, 2011 One year without comments... It would be good continue this project, maybe some of us can make these functions worthy to be part of the AutoIt oficial distribution I offer to test write examples for this library. Link to comment Share on other sites More sharing options...
Lakes Posted November 9, 2011 Share Posted November 9, 2011 (edited) One year without comments... It would be good continue this project, maybe some of us can make these functions worthy to be part of the AutoIt oficial distributionI offer to test write examples for this library.Yes please,see post 171 Edited November 9, 2011 by Lakes 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Edano Posted June 25, 2013 Share Posted June 25, 2013 two years without comments on this wonderful project. to make the new gdip functions work on XP, i found a working and relatively simple method described >here. an example script that includes gdip color manipulations and the convolution methods described above can be found >here. [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
Nerdworld Posted October 15, 2013 Share Posted October 15, 2013 (edited) Hey guys! I just wondered why there is a function to create a saturation matrix, but none for contrast and brightness - so i've written one based on the saturation-code - you may add it to your amazing library! ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_ColorMatrixCreateContrast ; Description ...: Creates and initializes a contrast color matrix ; Syntax.........: _GDIPlus_ColorMatrixCreateContrast($nCon) ; Parameters ....: $nCon - Color contrast factor ; Return values .: Success - $tagGDIPCOLORMATRIX structure that contains a contrast color matrix ; Failure - 0 ; Related .......: $tagGDIPCOLORMATRIX ; Author ........: Daniel Jaeger - http://nerdworld.de ; Example .......; No ; =============================================================================================================================== Func _GDIPlus_ColorMatrixCreateContrast($nCon) Local $tCM = DllStructCreate($tagGDIPCOLORMATRIX), $nT = (1 - $nCon) / 2 DllStructSetData($tCM, "m", $nCon, 1) DllStructSetData($tCM, "m", $nCon, 7) DllStructSetData($tCM, "m", $nCon, 13) DllStructSetData($tCM, "m", 1, 19) DllStructSetData($tCM, "m", $nT, 21) DllStructSetData($tCM, "m", $nT, 22) DllStructSetData($tCM, "m", $nT, 23) DllStructSetData($tCM, "m", 1, 25) Return $tCM EndFunc Edit: Added the same function for brightness and removed some useless lines. ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_ColorMatrixCreateBrightness ; Description ...: Creates and initializes a brightness color matrix ; Syntax.........: _GDIPlus_ColorMatrixCreateBrightness($nBri) ; Parameters ....: $nCon - Color brightness factor ; Return values .: Success - $tagGDIPCOLORMATRIX structure that contains a brightness color matrix ; Failure - 0 ; Related .......: $tagGDIPCOLORMATRIX ; Author ........: Daniel Jaeger - http://nerdworld.de ; Example .......; No ; =============================================================================================================================== Func _GDIPlus_ColorMatrixCreateBrightness($nBri) Local $tCM = DllStructCreate($tagGDIPCOLORMATRIX) DllStructSetData($tCM, "m", 1, 1) DllStructSetData($tCM, "m", 1, 7) DllStructSetData($tCM, "m", 1, 13) DllStructSetData($tCM, "m", 1, 19) DllStructSetData($tCM, "m", $nBri-1, 21) DllStructSetData($tCM, "m", $nBri-1, 22) DllStructSetData($tCM, "m", $nBri-1, 23) DllStructSetData($tCM, "m", 1, 25) Return $tCM EndFunc Edit: Example code expandcollapse popup#include <GDIP.au3> #include <GUIConstants.au3> _GDIPlus_Startup() $hGUI = GUICreate("Test", 380, 300) GUISetBkColor(0x00C080) $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBitmap = _GDIPlus_ImageLoadFromFile("test.jpg") Local $matrix = _GDIPlus_ColorMatrixCreate() ;Local $matrix = _GDIPlus_ColorMatrixCreateNegative() Local $brightness = _GDIPlus_ColorMatrixCreateBrightness(1.5) _GDIPlus_ColorMatrixMultiply($matrix, $brightness) Local $contrast = _GDIPlus_ColorMatrixCreateContrast(2) _GDIPlus_ColorMatrixMultiply($matrix, $contrast) Local $saturation = _GDIPlus_ColorMatrixCreateSaturation(0.5) _GDIPlus_ColorMatrixMultiply($matrix, $saturation) $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetColorMatrix($hIA, 0, True, DllStructGetPtr($matrix)) GUISetState() _GDIPlus_GraphicsDrawImageRectRectIA($hGraphics, $hBitmap, 0, 0, 380, 300, 0, 0, 380, 300, $hIA) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_ImageAttributesDispose($hIA) _GDIPlus_ImageDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() Regards, Daniel Edited October 15, 2013 by Nerdworld Link to comment Share on other sites More sharing options...
UEZ Posted October 15, 2013 Share Posted October 15, 2013 (edited) Should be already available in the latest beta (GDIPlus.au3) and some more functions in the next release. Br, UEZ Edited October 15, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
AZJIO Posted December 15, 2013 Share Posted December 15, 2013 (edited) GDIP_En.7z - Help file GDIP.chm In the example _GDIPlus_PathBrushCreate proportions do not like. Local $aPoints[11][2] = [[10], [303, 114], [215, 178], [248, 281], [160, 218], [72, 281], [105, 178], [17, 114], [126, 113], [160, 10], [194, 113]] Star adjustable expandcollapse popup#include <GDIP.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $hGUI, $hGraphics, $hBrush, $slider1, $slider2, $slider3, $slider4, $hSlider_Handle1, $hSlider_Handle2, $hSlider_Handle3, $hSlider_Handle4 Local $iRadius1 = 150, $iRadius2 = 58, $iCountAngle = 5, $iShift2 = 0 _Example() Func _Example() ; Инициализирует библиотеку GDI+ _GDIPlus_Startup() $hGUI = GUICreate("_Star", 500, 500) GUISetState() $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $SmoothingModeAntiAlias) ; Создает кисть, чтобы заполнить внутреннее пространство многоугольника $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF6600) $aPoints = _Star($iRadius1, $iRadius2, $iCountAngle, 1, $iShift2) _GDIPlus_GraphicsFillRect($hGraphics, 80, 90, 370, 370) _GDIPlus_GraphicsFillPolygon2($hGraphics, $aPoints, $hBrush) $slider1 = GUICtrlCreateSlider(10, 5, 200, 30) GUICtrlSetLimit(-1, 165, 10) GUICtrlSetData(-1, 150) $hSlider_Handle1 = GUICtrlGetHandle(-1) $slider2 = GUICtrlCreateSlider(10, 35, 200, 30) GUICtrlSetLimit(-1, 165, 10) GUICtrlSetData(-1, 58) $hSlider_Handle2 = GUICtrlGetHandle(-1) $slider3 = GUICtrlCreateSlider(220, 5, 200, 30) GUICtrlSetLimit(-1, 33, 2) GUICtrlSetData(-1, 5) $hSlider_Handle3 = GUICtrlGetHandle(-1) $slider4 = GUICtrlCreateSlider(220, 35, 200, 30) GUICtrlSetLimit(-1, +70, -70) GUICtrlSetData(-1, 0) $hSlider_Handle4 = GUICtrlGetHandle(-1) GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Очищает ресурсы _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) ; Закрывает библиотеку GDI+ _GDIPlus_Shutdown() EndFunc ; Func _Draw($hWnd, $Msg, $wParam, $lParam) ; EndFunc Func WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) ; _WinAPI_LoWord Local $value = BitShift($wParam, 16) ; _WinAPI_HiWord Switch $lParam Case $hSlider_Handle1 $iRadius1 = GUICtrlRead($slider1) Case $hSlider_Handle2 $iRadius2 = GUICtrlRead($slider2) Case $hSlider_Handle3 $iCountAngle = GUICtrlRead($slider3) Case $hSlider_Handle4 $iShift2 = GUICtrlRead($slider4) EndSwitch ; Создает случайные точки Local $aPoints = _Star($iRadius1, $iRadius2, $iCountAngle, 1, $iShift2) ; Local $aPoints = _Star(58, 150, 8, 0) ; Рисует заполненный многоугольник ; If $nScrollCode <> 5 Then _GDIPlus_GraphicsFillPolygon2($hGraphics, $aPoints, $hBrush) ; If $nScrollCode <> 8 Then _GDIPlus_GraphicsFillPolygon2($hGraphics, $aPoints, $hBrush) _GDIPlus_GraphicsFillRect($hGraphics, 80, 90, 370, 370) _GDIPlus_GraphicsFillPolygon2($hGraphics, $aPoints, $hBrush) WinSetTitle($hGUI, '', 'R1=' & $iRadius1 & ', R2=' & $iRadius2 & ', C=' & $iCountAngle & ', S=' & $iShift2) Return $GUI_RUNDEFMSG EndFunc Func _Star($iRadius1, $iRadius2, $iCountAngle = 5, $iShift = 0, $iShift2 = 0, $iOffset = 270) If $iCountAngle < 2 Then Return SetError(1) Local $iAngle = 360 / $iCountAngle If $iShift = 1 Then $iShift = $iAngle / 2 Else $iShift = 0 EndIf Local $aPoints[$iCountAngle*2+1][2] = [[$iCountAngle*2]], $j = 1, $f = $iShift, $iRadian = 180 / 3.14159265358979 ; MsgBox(0, 'Сообщение', $f) $iAngle2 = $iAngle / 2 - $iShift2 For $i = 1 To $iCountAngle $aPoints[$j][1] = Round($iRadius1 * Cos($f /$iRadian)) + $iOffset $aPoints[$j][0] = Round($iRadius1 * Sin($f /$iRadian)) + $iOffset $aPoints[$j+1][1] = Round($iRadius2 * Cos(($f + $iAngle2) / $iRadian)) + $iOffset $aPoints[$j+1][0] = Round($iRadius2 * Sin(($f + $iAngle2) / $iRadian)) + $iOffset $f += $iAngle $j += 2 Next Return $aPoints EndFunc Edited December 15, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
AZJIO Posted December 18, 2013 Share Posted December 18, 2013 (edited) Star in motion. expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include <GDIP.au3> #include <GUIConstantsEx.au3> #include <Array.au3> Example() Func Example() AutoItSetOption("GUIOnEventMode", 1) _GDIPlus_Startup() ;initialize GDI+ Local Const $iWidth = 600, $iHeight = 600, $iBgColor = 0x303030 ;$iBGColor format RRGGBB Global $hGUI = GUICreate("GDI+ example", $iWidth, $iHeight) ;create a test GUI GUISetBkColor($iBgColor, $hGUI) ;set GUI background color GUISetState(@SW_SHOW) ;create buffered graphics frame set for smoother gfx object movements Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics) Global $hGfxCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGfxCtxt, 2) ;sets the graphics object rendering quality (antialiasing) $GDIP_SMOOTHINGMODE_HIGHQUALITY Global $hPen = _GDIPlus_PenCreate(0xFFFF8060, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hGfxCtxt, 2) ; $GDIP_PIXELOFFSETMODE_HIGHQUALITY Global $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF8060) Local $iRadius1, $iRadius2, $iCountAngle, $iShift2 Local $aPoints GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") Local $iTmpRadius1 = 150 Local $iTmpRadius2 = 58 Local $iTmpCountAngle = 5 Local $iTmpShift2 = 5 Local $iTmpShift = 20 Local $iTmpSmooth = 0.2 Local $iRadius1 = 165 Local $iRadius2 = 50 Local $iCountAngle = 10 Local $iShift2 = 0 Local $iShift = 40 Local $iSmooth = 0 Local $iDeRadius1 = 1 Local $iDeRadius2 = 1 Local $iDeCountAngle = 1 Local $iDeShift2 = 1 Local $iDeShift = 10 Local $iDeSmooth = 0.1 _GetStarPar($iRadius1, $iTmpRadius1, $iDeRadius1, 10, 165) _GetStarPar($iRadius2, $iTmpRadius2, $iDeRadius2, 10, 165) _GetStarPar($iCountAngle, $iTmpCountAngle, $iDeCountAngle, 3, 33) _GetStarPar($iShift2, $iTmpShift2, $iDeShift2, 0, 70) _GetStarPar($iShift, $iTmpShift, $iDeShift, 0, 60) $iDeShift *= 10 _GetStarPar($iSmooth, $iTmpSmooth, $iDeSmooth, -2, 2, 0) $iDeSmooth /= 10 Do $iRadius1 += $iDeRadius1 $iRadius2 += $iDeRadius2 $iCountAngle += $iDeCountAngle $iShift2 += $iDeShift2 $iShift += $iDeShift $iSmooth += $iDeSmooth If $iRadius1 = $iTmpRadius1 Then _GetStarPar($iRadius1, $iTmpRadius1, $iDeRadius1, 10, 265) If $iRadius2 = $iTmpRadius2 Then _GetStarPar($iRadius2, $iTmpRadius2, $iDeRadius2, 10, 265) If $iCountAngle = $iTmpCountAngle Then _GetStarPar($iCountAngle, $iTmpCountAngle, $iDeCountAngle, 3, 33) If Abs($iShift2 - $iTmpShift2) < 2 Then _GetStarPar($iShift2, $iTmpShift2, $iDeShift2, -70, 70) ; If $iShift2 = $iTmpShift2 Then _GetStarPar($iShift2, $iTmpShift2, $iDeShift2, 70, 350, 1) ; Пересечений больше при большем сдвиге If Abs($iShift - $iTmpShift) < 22 Then _GetStarPar($iShift, $iTmpShift, $iDeShift, 0, 350) $iDeShift *= 10 EndIf If Abs($iSmooth - $iTmpSmooth) < 0.1 Then _GetStarPar($iSmooth, $iTmpSmooth, $iDeSmooth, -2, 2, 0) $iDeSmooth /= 10 ; MsgBox(0, '', $iSmooth & @LF & $iTmpSmooth & @LF & $iDeSmooth) EndIf WinSetTitle($hGUI, '', 'R1=' & $iRadius1 & ' R2=' & $iRadius2 & ' A=' & $iCountAngle & ' S2=' & $iShift2 & ' S=' & $iShift & ' Sm=' & $iSmooth) $aPoints = _Star($iRadius1, $iRadius2, $iCountAngle, $iShift, $iShift2) _GDIPlus_GraphicsClear($hGfxCtxt, 0xFF000000 + $iBgColor) ;clear bitmap for repaint _GDIPlus_GraphicsDrawClosedCurve2($hGfxCtxt, $aPoints, $iSmooth, $hPen) ;draw closed curve ; _GDIPlus_GraphicsFillClosedCurve2($hGfxCtxt, $aPoints, $iSmooth, $hBrush) ; Fill _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0) ;copy bitmap to graphic handle (GUI) Until Not Sleep(50) ;sleep 30 ms to avoid high cpu usage EndFunc ;==>Example Func _GetStarPar(ByRef $iR, ByRef $iTmpR, ByRef $iDeR, $L1, $L2, $int = 1) Do $iTmpR = Random($L1, $L2, $int) Until $iTmpR <> $iR ; Повторять покуда не будет различие If $iTmpR < $iR Then $iDeR = -1 Else $iDeR = 1 EndIf EndFunc ;==>_GetStarPar Func _Exit() ;cleanup GDI+ resources _GDIPlus_BrushDispose($hBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGfxCtxt) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() GUIDelete($hGUI) Exit EndFunc ;==>_Exit Func _Star($iRadius1, $iRadius2, $iCountAngle = 5, $iShift = 0, $iShift2 = 0, $iOffset = 300) If $iCountAngle < 2 Then Return SetError(1) Local $iAngle = 360 / $iCountAngle Local $aPoints[$iCountAngle * 2 + 1][2] = [[$iCountAngle * 2]], $j = 1, $f = $iShift, $iRadian = 180 / 3.14159265358979 ; MsgBox(0, 'Сообщение', $f) $iAngle2 = $iAngle / 2 - $iShift2 For $i = 1 To $iCountAngle $aPoints[$j][1] = Round($iRadius1 * Cos($f / $iRadian)) + $iOffset $aPoints[$j][0] = Round($iRadius1 * Sin($f / $iRadian)) + $iOffset $aPoints[$j + 1][1] = Round($iRadius2 * Cos(($f + $iAngle2) / $iRadian)) + $iOffset $aPoints[$j + 1][0] = Round($iRadius2 * Sin(($f + $iAngle2) / $iRadian)) + $iOffset $f += $iAngle $j += 2 Next Return $aPoints EndFunc ;==>_Star Edited December 19, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
UEZ Posted December 18, 2013 Share Posted December 18, 2013 AZJIO, a lot of GDI+ functions from GDIP.au3 have been integrated into the latest beta version - just have a look. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
AZJIO Posted December 18, 2013 Share Posted December 18, 2013 (edited) UEZ I used the example of 3.3.9.25 (_GDIPlus_GraphicsDrawClosedCurve2). I made a calculation of the star. 282 unique functions are absent in 3.3.9.25. Perhaps they have other names. Edited December 18, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now