Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/03/2014 in all areas

  1. requires AutoIt 3.3.10.0+ #include <GDIPlus.au3> Opt("MustDeclareVars", 1) _GDIPlus_Startup() Global $hBitmap = _CreateAutoItLogo(1920, 1200);Set resolution _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Logo.bmp") _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "\Logo.bmp") Func _Draw_Inner($hContext, $hPath) Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3] * 0.4) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.5, 0.5) Local $aPBlend[4][2] = [[3]] $aPBlend[1][0] = 0xFF181F39 $aPBlend[1][1] = 0 $aPBlend[2][0] = 0xFF394D82 $aPBlend[2][1] = 0.3 $aPBlend[3][0] = 0xFF607CD0 $aPBlend[3][1] = 1 _GDIPlus_PathBrushSetPresetBlend($hBrush, $aPBlend) _GDIPlus_PathBrushSetGammaCorrection($hBrush, True) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush) _GDIPlus_BrushDispose($hBrush) Local $hPath_Clone = _GDIPlus_PathClone($hPath) Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.5), -$aBounds[1]) _GDIPlus_MatrixScale($hMatrix, 0.85, 0.6, True) _GDIPlus_MatrixTranslate($hMatrix, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1], True) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.45, $aBounds[1] + $aBounds[3] * 0.1) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 0.9) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) $hPath_Clone = _GDIPlus_PathClone($hPath) _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.5), -($aBounds[1] + $aBounds[3])) _GDIPlus_MatrixScale($hMatrix, 0.95, 0.8, True) _GDIPlus_MatrixTranslate($hMatrix, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3], True) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.65, $aBounds[1] + $aBounds[3] * 0.70) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFDDEEFF) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 0.7) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.3, 0.2) _GDIPlus_PathBrushSetGammaCorrection($hBrush, True) _GDIPlus_GraphicsSetCompositingQuality($hContext, 3) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_GraphicsSetCompositingQuality($hContext, 1) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) _GDIPlus_MatrixDispose($hMatrix) EndFunc ;==>_Draw_Inner Func _Draw_A($hContext, $hPath, $hBrush_Alu) Local $hPath_Clone = _GDIPlus_PathClone($hPath) Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath_Clone) Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.5), -($aBounds[1] + $aBounds[3] * 0.4)) _GDIPlus_MatrixScale($hMatrix, 1.01, 1.02, True) _GDIPlus_MatrixTranslate($hMatrix, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3] * 0.43, True) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF000000) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.91, 0.91) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) $hPath_Clone = _GDIPlus_PathClone($hPath) Local $hPen = _GDIPlus_PenCreate(0xDD000000, 2) _GDIPlus_PenSetLineJoin($hPen, 1) _GDIPlus_GraphicsDrawPath($hContext, $hPath, $hPen) _GDIPlus_PenDispose($hPen) Local $hBmp = _GDIPlus_BitmapCreateFromScan0($aBounds[2], $aBounds[3]) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsFillRect($hGfx, 0, 0, $aBounds[2], $aBounds[3], $hBrush_Alu) _GDIPlus_GraphicsSetClipPath($hContext, $hPath) Local $hImgAttrib = _GDIPlus_ImageAttributesCreate() Local $tColorMatrix = _GDIPlus_ColorMatrixCreateScale(0.8, 0.9, 1.1) _GDIPlus_ImageAttributesSetColorMatrix($hImgAttrib, 1, 1, DllStructGetPtr($tColorMatrix)) _GDIPlus_GraphicsDrawImageRectRect($hContext, $hBmp, 0, 0, $aBounds[2], $aBounds[3], $aBounds[0], $aBounds[1], $aBounds[2], $aBounds[3], $hImgAttrib) _GDIPlus_ImageAttributesDispose($hImgAttrib) _GDIPlus_GraphicsResetClip($hContext) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_BitmapDispose($hBmp) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3] * 1.2) _GDIPlus_PathBrushSetCenterColor($hBrush, 0) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xFFFFFFFF) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.96, 0.96) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 1) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3] * 0.1) _GDIPlus_PathBrushSetCenterColor($hBrush, 0) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xFF000000) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.96, 0.96) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) Local $aData = _GDIPlus_PathGetData($hPath) Local $aPnt[6][2] = [[5]] $aPnt[1][0] = $aData[1][0] $aPnt[1][1] = $aData[1][1] $aPnt[2][0] = $aData[2][0] $aPnt[2][1] = $aData[2][1] $aPnt[3][0] = $aData[3][0] $aPnt[3][1] = $aData[3][1] $aPnt[4][0] = $aData[3][0] + ($aData[11][0] - $aData[3][0]) * 0.2 $aPnt[4][1] = $aData[12][1] $aPnt[5][0] = $aData[12][0] $aPnt[5][1] = $aData[12][1] _GDIPlus_PathReset($hPath_Clone) _GDIPlus_PathAddPolygon($hPath_Clone, $aPnt) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aData[12][0] + ($aData[11][0] - $aData[12][0]) * 1.2, $aData[12][1]) _GDIPlus_PathBrushSetCenterColor($hBrush, 0) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xFFFFFFFF) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.985, 0.91) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) $aData[0][0] = 5 $aData[5][2] = 129 $hPath_Clone = _GDIPlus_PathCreate2($aData) _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_MatrixTranslate($hMatrix, -$aData[4][0], -$aData[2][1]) _GDIPlus_MatrixScale($hMatrix, 1.12, 1.12, True) _GDIPlus_MatrixTranslate($hMatrix, $aData[4][0], $aData[2][1], True) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aData[4][0], $aData[2][1]) Local $aPBlend[4][2] = [[3]] $aPBlend[1][0] = 0x00000000 $aPBlend[1][1] = 0 $aPBlend[2][0] = 0xAF000000 $aPBlend[2][1] = 0.1 $aPBlend[3][0] = 0 $aPBlend[3][1] = 1 _GDIPlus_PathBrushSetPresetBlend($hBrush, $aPBlend) _GDIPlus_GraphicsSetClipPath($hContext, $hPath_Clone) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush) _GDIPlus_GraphicsResetClip($hContext) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) _GDIPlus_MatrixDispose($hMatrix) EndFunc ;==>_Draw_A Func _Draw_Outer($hContext, $hPath_O, $hPath_I, $hBrush_Alu) Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath_I) Local $hPath = _GDIPlus_PathClone($hPath_O) Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $aBounds[2] * 0.05, $aBounds[3] * 0.05) _GDIPlus_PathTransform($hPath, $hMatrix) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.1, $aBounds[1] + $aBounds[2] * 0.1) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF000000) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.84, 0.92) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath) $hPath = _GDIPlus_PathClone($hPath_O) _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.7), -($aBounds[1] + $aBounds[3] * 0.9)) _GDIPlus_MatrixScale($hMatrix, 1.07, 1.06, True) _GDIPlus_MatrixTranslate($hMatrix, $aBounds[0] + $aBounds[2] * 0.69, $aBounds[1] + $aBounds[3] * 0.895, True) _GDIPlus_PathTransform($hPath, $hMatrix) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 1) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.4, 0.3) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath) $hPath = _GDIPlus_PathClone($hPath_O) _GDIPlus_PathAddPath($hPath, $hPath_I) _GDIPlus_GraphicsSetClipPath($hContext, $hPath) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush_Alu) _GDIPlus_GraphicsResetClip($hContext) _GDIPlus_PathDispose($hPath) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_O) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.8, $aBounds[1] + $aBounds[3] * 0.8) _GDIPlus_PathBrushSetCenterColor($hBrush, 0) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.98, 0.98) _GDIPlus_GraphicsFillPath($hContext, $hPath_O, $hBrush) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.2, $aBounds[1] + $aBounds[3] * 0.8) _GDIPlus_GraphicsFillPath($hContext, $hPath_O, $hBrush) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.4, $aBounds[1]) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xFF000000) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.98, 0.98) _GDIPlus_GraphicsFillPath($hContext, $hPath_O, $hBrush) _GDIPlus_BrushDispose($hBrush) Local $hPath_Clone = _GDIPlus_PathClone($hPath_I) _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.5), -($aBounds[1] + $aBounds[3] * 0.5)) _GDIPlus_MatrixScale($hMatrix, 1.02, 1.02, True) _GDIPlus_MatrixTranslate($hMatrix, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3] * 0.51, True) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.98, 0.98) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) $hPath_Clone = _GDIPlus_PathClone($hPath_I) _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.5), -($aBounds[1] + $aBounds[3] * 0.5)) _GDIPlus_MatrixScale($hMatrix, 1.02, 1.02, True) _GDIPlus_MatrixTranslate($hMatrix, $aBounds[0] + $aBounds[2] * 0.5, $aBounds[1] + $aBounds[3] * 0.49, True) _GDIPlus_PathTransform($hPath_Clone, $hMatrix) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath_Clone) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF000000) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.96, 0.96) _GDIPlus_GraphicsFillPath($hContext, $hPath_Clone, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath_Clone) Local $hPen = _GDIPlus_PenCreate(0xFF000000, 2) _GDIPlus_GraphicsDrawPath($hContext, $hPath_I, $hPen) _GDIPlus_GraphicsDrawPath($hContext, $hPath_O, $hPen) _GDIPlus_PenDispose($hPen) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_GraphicsResetClip($hContext) EndFunc ;==>_Draw_Outer Func _Draw_Light($hContext, $hPath_O, $hPath_I, $hPath_A) Local $hPath = _GDIPlus_PathClone($hPath_O) _GDIPlus_PathAddPath($hPath, $hPath_I) _GDIPlus_PathAddPath($hPath, $hPath_A) Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath) Local $hBrush = _GDIPlus_LineBrushCreate($aBounds[0] + $aBounds[2], $aBounds[1], $aBounds[0] + $aBounds[2] * 0.8, $aBounds[1] + $aBounds[3], 0, 0xDDFFFFFF, 3) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1) Local $aBlend[8][2] = [[7]] $aBlend[1][0] = 0.4 $aBlend[1][1] = 0 $aBlend[2][0] = 0.8 $aBlend[2][1] = 0.1 $aBlend[3][0] = 0.3 $aBlend[3][1] = 0.3 $aBlend[4][0] = 0.7 $aBlend[4][1] = 0.4 $aBlend[5][0] = 0.3 $aBlend[5][1] = 0.7 $aBlend[6][0] = 0 $aBlend[6][1] = 0.8 $aBlend[7][0] = 0.2 $aBlend[7][1] = 1 _GDIPlus_LineBrushSetBlend($hBrush, $aBlend) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath) EndFunc ;==>_Draw_Light Func _Draw_3($hContext, $hPath, $hBrush_Alu) Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath) Local $hBmp = _GDIPlus_BitmapCreateFromScan0($aBounds[2] + 1, $aBounds[3] + 1) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsFillRect($hGfx, 0, 0, $aBounds[2] + 1, $aBounds[3] + 1, $hBrush_Alu) Local $tColorMatrix = _GDIPlus_ColorMatrixCreateScale(1.3, 1.4, 2) Local $hImgAttrib = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetColorMatrix($hImgAttrib, 1, 1, DllStructGetPtr($tColorMatrix)) _GDIPlus_GraphicsSetClipPath($hContext, $hPath) _GDIPlus_GraphicsDrawImageRectRect($hContext, $hBmp, 0, 0, $aBounds[2], $aBounds[3], $aBounds[0], $aBounds[1], $aBounds[2], $aBounds[3], $hImgAttrib) _GDIPlus_GraphicsResetClip($hContext) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_ImageAttributesDispose($hImgAttrib) Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterPoint($hBrush, $aBounds[0] + $aBounds[2] * 0.22, $aBounds[1] + $aBounds[3] * 0.5) _GDIPlus_PathBrushSetCenterColor($hBrush, 0x5FFFFFFF) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xFF6080FF) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.8, 0.4) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1) Local $aPBlend[5][2] = [[4]] $aPBlend[1][0] = 0xFF8090FF $aPBlend[1][1] = 0 $aPBlend[2][0] = 0x208090FF $aPBlend[2][1] = 0.2 $aPBlend[3][0] = 0x00000000 $aPBlend[3][1] = 0.25 $aPBlend[4][0] = 0xFFFFFFFF $aPBlend[4][1] = 1 _GDIPlus_PathBrushSetPresetBlend($hBrush, $aPBlend) _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush) _GDIPlus_BrushDispose($hBrush) EndFunc ;==>_Draw_3 Func _Draw_BG($hContext, $iWidth, $iHeight, $iColor1, $iColor2) _GDIPlus_GraphicsClear($hContext, $iColor1) Local $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddEllipse($hPath, 0, 0, $iWidth, $iHeight) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterColor($hBrush, $iColor2) _GDIPlus_PathBrushSetSurroundColor($hBrush, $iColor1) _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathDispose($hPath) EndFunc ;==>_Draw_BG Func _CreateAutoItLogo($iWidth, $iHeight) Global $aLogo[79][3] = [[78, 0, 0],[192.180, 15.750, 0],[226.790, 15.730, 3],[259.230, 24.910, 3],[287.250, 40.920, 3],[294.600, 17.470, 3],[316.500, 0.470, 3],[342.350, 0.470, 3],[374.280, 0.470, 3],[400.130, 26.320, 3], _ [400.130, 58.250, 3],[400.130, 84.250, 3],[382.940, 106.240, 3],[359.350, 113.490, 3],[374.980, 141.270, 3],[383.930, 173.290, 3],[383.930, 207.430, 3],[383.930, 313.340, 3],[298.080, 399.190, 3],[192.180, 399.190, 3], _ [86.320, 399.190, 3],[0.470, 313.340, 3],[0.470, 207.430, 3],[0.470, 101.570, 3],[86.320, 15.730, 3],[192.180, 15.750, 131],[192.180, 359.650, 0],[275.760, 359.210, 3],[343.950, 291.020, 3],[343.950, 207.430, 3], _ [343.950, 123.850, 3],[275.760, 55.710, 3],[192.180, 55.710, 3],[108.590, 55.710, 3],[40.450, 123.850, 3],[40.450, 207.430, 3],[40.450, 291.020, 3],[108.590, 359.210, 3],[192.180, 359.650, 131],[142.450, 263.800, 0], _ [170.520, 225.280, 1],[234.980, 225.280, 1],[192.790, 164.960, 1],[122.250, 263.470, 1],[67.250, 263.470, 1],[163.590, 129.220, 1],[179.650, 107.080, 3],[207.390, 106.380, 3],[223.300, 129.220, 3],[317.200, 263.470, 1], _ [142.450, 263.800, 1],[355.481, 44.846, 0],[362.130, 44.845, 3],[361.952, 52.088, 3],[355.481, 52.088, 3],[325.026, 52.089, 1],[333.159, 63.310, 1],[355.719, 63.310, 1],[361.715, 63.427, 3],[361.595, 70.254, 3], _ [355.719, 70.254, 3],[313.153, 70.256, 1],[323.245, 83.970, 1],[355.006, 83.970, 1],[366.167, 83.908, 3],[371.688, 80.524, 3],[374.122, 74.588, 3],[376.674, 68.354, 3],[374.359, 61.052, 3],[368.066, 58.381, 3], _ [378.040, 54.937, 3],[376.437, 43.954, 3],[375.072, 40.511, 3],[372.223, 33.447, 3],[364.208, 31.250, 3],[355.362, 31.250, 3],[310.660, 31.252, 1],[320.692, 44.846, 1],[355.481, 44.846, 129]] Local $hPath_Logo = _GDIPlus_PathCreate2($aLogo) Local $hIter = _GDIPlus_PathIterCreate($hPath_Logo) Local $iIterCnt = _GDIPlus_PathIterGetSubpathCount($hIter) Local $aPath_Logo[$iIterCnt + 1] = [$iIterCnt] For $i = 1 To $iIterCnt $aPath_Logo[$i] = _GDIPlus_PathCreate() _GDIPlus_PathIterNextSubpathPath($hIter, $aPath_Logo[$i]) Next _GDIPlus_PathIterDispose($hIter) Local $aBounds = _GDIPlus_PathGetWorldBounds($aPath_Logo[2]) Local $fScale = ($iHeight * 0.5) / $aBounds[3] Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] * 0.5), -($aBounds[1] + $aBounds[3] * 0.5)) _GDIPlus_MatrixScale($hMatrix, $fScale, $fScale, True) _GDIPlus_MatrixTranslate($hMatrix, $iWidth * 0.5, $iHeight * 0.5, True) For $i = 1 To $aPath_Logo[0] _GDIPlus_PathTransform($aPath_Logo[$i], $hMatrix) Next _GDIPlus_MatrixDispose($hMatrix) Local $hBrush_Alu = _CreateAluTexture(400, 400) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hContext, 2) _Draw_BG($hContext, $iWidth, $iHeight, 0xFF1E375A, 0xFF325A88) _Draw_Outer($hContext, $aPath_Logo[1], $aPath_Logo[2], $hBrush_Alu) _Draw_Inner($hContext, $aPath_Logo[2]) _Draw_A($hContext, $aPath_Logo[3], $hBrush_Alu) _Draw_3($hContext, $aPath_Logo[4], $hBrush_Alu) _Draw_Light($hContext, $aPath_Logo[1], $aPath_Logo[2], $aPath_Logo[3]) _GDIPlus_BrushDispose($hBrush_Alu) _GDIPlus_PathDispose($hPath_Logo) For $i = 1 To $aPath_Logo[0] _GDIPlus_PathDispose($aPath_Logo[$i]) Next _GDIPlus_GraphicsDispose($hContext) Return $hBitmap EndFunc ;==>_CreateAutoItLogo Func _CreateAluTexture($iW, $iH, $iBlurDist = 14, $fBlurTrans = 0.6) $iBlurDist = Ceiling($iBlurDist) $iBlurDist += 1 - Mod($iBlurDist, 2) Local $iOverSize = 0 For $i = 1 To $iBlurDist Step 2 $iOverSize += $i + $i + 1 Next Local $iWO = $iW + $iOverSize Local $iNoiseSize = 40 Local $hBmp_Noise = _GDIPlus_BitmapCreateFromScan0($iNoiseSize, $iNoiseSize) Local $hGfx_Noise = _GDIPlus_ImageGetGraphicsContext($hBmp_Noise) Local $tData = _GDIPlus_BitmapLockBits($hBmp_Noise, 0, 0, $iNoiseSize, $iNoiseSize, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB) Local $iStride = DllStructGetData($tData, "Stride") Local $iWidth = DllStructGetData($tData, "Width") Local $iHeight = DllStructGetData($tData, "Height") Local $pScan0 = DllStructGetData($tData, "Scan0") Local $tPixel = DllStructCreate("dword[" & $iWidth * $iHeight & "];", $pScan0) Local $iAmp For $row = 0 To $iHeight - 1 For $col = 0 To $iWidth - 1 $iAmp = Random(0x4F, 0xFF, 1) DllStructSetData($tPixel, 1, BitOR(0xFF000000, BitShift($iAmp, -16), BitShift($iAmp, -8), $iAmp), $row * $iWidth + $col + 1) Next Next _GDIPlus_BitmapUnlockBits($hBmp_Noise, $tData) Local $hBmp_Full = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full = _GDIPlus_ImageGetGraphicsContext($hBmp_Full) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full, 2) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 7) Local $iXOff, $iYOff, $iSizeX, $iSizeY For $y = 0 To $iH Step $iNoiseSize / 2 For $x = 0 To $iWO Step $iNoiseSize / 2 $iXOff = Random(0, $iNoiseSize / 2, 1) $iYOff = Random(0, $iNoiseSize / 2, 1) $iSizeX = $iNoiseSize - $iXOff $iSizeY = $iNoiseSize - $iYOff _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full, $hBmp_Noise, $iXOff, $iYOff, $iSizeX, $iSizeY, $x, $y, $iSizeX, $iSizeY) Next Next _GDIPlus_GraphicsDispose($hGfx_Noise) _GDIPlus_BitmapDispose($hBmp_Noise) Local $hBmp_Full2 = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full2 = _GDIPlus_ImageGetGraphicsContext($hBmp_Full2) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full2, 2) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full2, 7) Local $tColorMatrix = _GDIPlus_ColorMatrixCreateScale(1, 1, 1, $fBlurTrans) Local $hImgAttrib = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetColorMatrix($hImgAttrib, 1, 1, DllStructGetPtr($tColorMatrix), 0, 0) For $i = 1 To $iBlurDist Step 2 _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full2, $hBmp_Full, 0, 0, $iWO, $iH, $i, 0, $iWO, $iH, $hImgAttrib) _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full, $hBmp_Full2, 0, 0, $iWO, $iH, $i + 1, 0, $iWO, $iH, $hImgAttrib) Next _GDIPlus_ImageAttributesDispose($hImgAttrib) _GDIPlus_GraphicsDispose($hGfx_Full2) _GDIPlus_BitmapDispose($hBmp_Full2) _GDIPlus_GraphicsDispose($hGfx_Full) Local $hTXT_Alu = _GDIPlus_TextureCreate2($hBmp_Full, $iOverSize, 0, $iW, $iH, 3) _GDIPlus_BitmapDispose($hBmp_Full) Return $hTXT_Alu EndFunc ;==>_CreateAluTexture enjoy E
    3 points
  2. BugFix version - 27 Dec 23 Fixed: No default value set for the MaxWidth parameter - took 12 years for someone to notice it! New UDF and new examples below and in zip. I just realised that although I have posted versions of this UDF many times in Help topics, I had never actually posted a "final" version here in Example scripts - better late than never, I suppose! StringSize takes a text string and calculates the size of label required to hold it as well as formatting the string to fit. Now AutoIt will, of course, size a label automatically to fit a text string, but it will not format the string in any way - what you use as the string is what you get in the label. If you do set any label sizes the text will be wrapped, but you can only determine the correct size of the label by trial and error. StringSize will, however, reformat the string to fit in a given width and tell you the required height so that you can read it all - whatever the font type or size - and you do not have to do the formatting beforehand. Here is a simple example to show what I mean (you need the UDF in the same folder for all the examples): And here is an example showing how StringSize can deal with different fonts and text sizes: You can see that the GUI is perfectly sized each time and that the button is always the right size and in the right place. StringSize returns an array which contains the formatted text to display and the size of the label needed to display it. All you need to do is to use the array elements when you create your label. Try changing the values in $aFont and $aSize if you want to try you own favourites - but beware, StringSize will return an error if you make the size so large that it cannot fit a word into the label width. NEW A more complex example showing how formatted and unformatted text can be sized correctly. The width of GUI holding the unformatted text varies randomly in width (the current value is displayed at top right): NEW And a final example showing how you can get your text in the largest possible font to fit in a given space: Finally here is the UDF itself: And all 5 files in zip format: StringSize.zip I hope you find this useful - I certainly do. M23
    1 point
  3. TinyPicSharer : A simple and handy tool for capture window or picture by mouse grab and an uploader for 10 Pic Hosters ! You can also Resize, Convert, Optimize, add WaterMark to your images easily. (optimization with jpegtran.exe, optipng.exe, gifsicle.exe command line tools) In plus it can extract images from Docs (pdf, doc, docx, odt, odp, ppt, pptx, pps, ppsx) (Doc extraction with b2xtranslator and pdfextract.exe command line tools) Just Drag'n drop a picture/doc on the Host Logo for load it. I have replaced Curl by WinHttp functions and TrIDLib.DLL by my own FileGetType function. Previous downloads : 1343 Update of 8 June 2013 source and executable are available in the Download Section See Tray menu for options. Double click on his tray icon for restore the gui. >zlib.au3, WinHttp.au3, >WinAPIEx UDF are needed. ( Thanks to Ward, trancexx, Yashield ) Hope you 'll find it usefull !
    1 point
  4. Melba23

    GUI running as a .jpg

    GraaF1337, Hiding files under false extensions is not something we would want to support. Thread closed. That makes 2 out of 2 so far - please try not to make it a hat-trick. M23
    1 point
  5. Do you have MozRepl installed? FF UDF need MozRepl
    1 point
  6. jchd

    IsDir

    You should be using the full Scite4AutoIt3 instal plus the latest release (and even the current beta, it's working nicely). Clearly your version is outdated and doesn't offer the feature. With the new version, something like $myvar = FileFindNextFile($handle) If Not @error Then If @extended = 1 Then ; code for directory Else ; code for simple file EndIf Else ; code for no more file, e.g. ExitLoop EndIf
    1 point
  7. I didn't look at your script, but in case it helps here is an example I did for someone to resize child windows when th eparent is resized. #include <GuiConstants.au3> #include <windowsconstants.au3> Const $SM_CXFIXEDFRAME = 7 Global Const $WM_ENTERSIZEMOVE = 0x231,$WM_EXITSIZEMOVE = 0x232 Global $guiWid = 500, $Guiht = 500 Global Const $WS_EX_COMPOSITED = 0x2000000 $Main_GUI = GUICreate("Main", 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),$WS_EX_COMPOSITED);, $WS_EX_LAYERED);$WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX ;$gamegui = GUICreate("QBC", 1280, 1024, -1, -1, $WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX, $WS_EX_LAYERED) GUISetBkColor(0xfffaf0, $Main_GUI) GUISetState(@SW_SHOW, $Main_GUI) $Btn_Exit = GUICtrlCreateButton("E&xit", 10, 10, 90, 20) GUICtrlSetResizing(-1,BitOr($Gui_DOCKTOP,$GUI_DOCKLEFT,$GUI_DOCKWIDTH,$GUI_DOCKHEIGHT)) $wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION) $wtitle = $wtitle[0] $wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME) $wside = $wside[0] $childHt = ($GuiHt - 50)/2 - $wtitle - 2* $wside $childWid = $GuiWid/2 - 2 * $wside $Child1_GUI = GUICreate("Child1",$childWid, $childHt, 0, 50, $WS_CAPTION);,$WS_EX_LAYERED) GUISetBkColor(0xffffff, $Child1_GUI) $Btn_Test = GUICtrlCreateButton("Test", 10, 10, 90, 20) DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child1_GUI), "hwnd", WinGetHandle($Main_GUI)) GUISetState(@SW_SHOW, $Child1_GUI) $Child2_GUI = GUICreate("Child2", $childWid, $childHt, $GuiWid/2, 50);, $WS_POPUP) GUISetBkColor(0x0ff0000, $Child2_GUI) GUISetState($Child2_GUI) DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child2_GUI), "hwnd", WinGetHandle($Main_GUI)) GUISetState(@SW_SHOW, $Child2_GUI) $Child3_GUI = GUICreate("Child3", $childWid, $childHt, 0, 50 + $childHt + 2*$wside + $wtitle, $WS_CAPTION);,$WS_EX_LAYERED) GUISetBkColor(0x00ff00, $Child3_GUI) DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child3_GUI), "hwnd", WinGetHandle($Main_GUI)) GUISetState(@SW_SHOW, $Child3_GUI) $Child4_GUI = GUICreate("Child4", $childWid, $childHt, $GuiWid/2, 50 +$childHt + 2*$wside + $wtitle);, $WS_POPUP) GUISetBkColor(0x00000ff, $Child4_GUI) DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child4_GUI), "hwnd", WinGetHandle($Main_GUI)) GUISetState(@SW_SHOW, $Child4_GUI) GuiSwitch($Main_GUI) GUIRegisterMsg($WM_SIZE, "SetChildrenToBed") ;GUIRegisterMsg($WM_ENTERSIZEMOVE,"ensm") ;GUIRegisterMsg($WM_EXITSIZEMOVE,"exsm") Opt("mousecoordmode", 2) $winact = '' While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Btn_Exit Exit Case $Btn_Test MsgBox(0, "Test", "Hit Button on Child Window") EndSwitch WEnd Func SetChildrenToBed($hWnd,$iMsg,$wparam,$lparam) Local $clientHt = BitAnd($lparam,0xffff) Local $clientWid = BitShift($lparam,16) WinMove($Child1_GUI,"",0,50,$clientHt/2,($clientWid-50)/2) WinMove($Child2_GUI,"",$clientHt/2,50,$clientHt/2,($clientWid-50)/2) WinMove($Child3_GUI,"",0,50 + ($clientWid-50)/2,$clientHt/2,($clientWid-50)/2) WinMove($Child4_GUI,"",$clientHt/2,50 + ($clientWid-50)/2,$clientHt/2,($clientWid-50)/2) EndFunc Func ensm() GUISetStyle( BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),$WS_EX_COMPOSITED,$Main_GUI) EndFunc func exsm() GUISetStyle( BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),-1,$Main_GUI) EndFunc
    1 point
×
×
  • Create New...