#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <FontConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Const $HORZRES = 8
Const $VERTRES = 10
;Const $PS_SOLID = 0
;Const $PS_DASH = 1
;Const $PS_DOT = 2
;Const $PS_DASHDOT = 3
;Const $PS_DASHDOTDOT = 4
;Const $PS_NULL = 5
;Const $PS_INSIDEFRAME = 6
Const $AD_COUNTERCLOCKWISE = 1
Const $AD_CLOCKWISE = 2
Global Const $tagDOCINFO = "int Size;" & _ ; int cbSize;
"ptr DocName;" & _ ; LPCTSTR lpszDocName;
"ptr Output;" & _ ; LPCTSTR lpszOutput;
"ptr Datatype;" & _ ; LPCTSTR lpszDatatype;
"dword Type" ; DWORD fwType;
Global Const $__WINAPCONSTANT_LOGPIXELSX = 88
Global Const $__WINAPCONSTANT_LOGPIXELSY = 90
Dim $aPic[4]
; Настройки печати
Global $s_DocName = 'AutoIt' ; имя документа при печати
Global $iX = 0 ; X - координата левого верхнего угла изображения на листе при печати
Global $iY = 0 ; Y - координата левого верхнего угла изображения на листе при печати
Global $iW = 700 ; ширина изображения на листе при печати
Global $iH = 800 ; высота изображения на листе при печати
Global $iPrinter = 0 ; 0 - принтер по умолчанию, 1 - отображать окно ввода имени принтера
#region ### START Koda GUI section ### Form=C:\Program Files\koda_1.7.3.0\Forms\Form1.kxf
$Form1 = GUICreate('Form1', 405, 700, 654, 116, -1, 0x00000010, $WS_EX_ACCEPTFILES)
GUISetBkColor(0x808080)
$Pic1 = GUICtrlCreatePic('', 28, 18, 165, 135)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$Group1 = GUICtrlCreateGroup('Картинка 1', 20, 5, 180, 155)
GUICtrlSetFont(-1, 8, 400, 0, 'Arial')
$Pic2 = GUICtrlCreatePic('', 211, 18, 165, 135)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup('Картинка 2', 203, 5, 180, 155)
GUICtrlSetFont(-1, 8, 400, 0, 'Arial')
$Pic3 = GUICtrlCreatePic('', 28, 178, 165, 135)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup('Картинка 3', 20, 165, 180, 155)
GUICtrlSetFont(-1, 8, 400, 0, 'Arial')
$Pic4 = GUICtrlCreatePic('', 211, 178, 165, 135)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup('Картинка 4', 203, 165, 180, 155)
GUICtrlSetFont(-1, 8, 400, 0, 'Arial')
$Comment = GUICtrlCreateInput('Comment', 8, 330, 185, 21)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$Button1 = GUICtrlCreateButton('Сохранить как', 8, 356, 163, 25)
GUICtrlSetBkColor(-1, 0x008080)
$Button2 = GUICtrlCreateButton('Печать', 232, 356, 163, 25)
GUICtrlSetBkColor(-1, 0x008080)
$Button3 = GUICtrlCreateButton('Предпросмотр', 232, 330, 163, 25)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$PicPreview = GUICtrlCreatePic('', 5, 410, 395, 250)
GUICtrlSetBkColor(-1, 0x008080)
GUICtrlCreateGroup('Предпросмотр', 2, 395, 400, 265)
GUICtrlSetFont(-1, 8, 400, 0, 'Arial')
GUISetState(@SW_SHOW)
;~ WinSetOnTop($Form1, '', 1)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case -13
If StringRegExp(@GUI_DragFile, '(?i)(.png)|(.bmp)|(.jpg)|(.jpeg)', 0) Then
GUICtrlSetImage(@GUI_DropId, @GUI_DragFile)
Switch @GUI_DropId
Case $Pic1
$aPic[0] = @GUI_DragFile
Case $Pic2
$aPic[1] = @GUI_DragFile
Case $Pic3
$aPic[2] = @GUI_DragFile
Case $Pic4
$aPic[3] = @GUI_DragFile
EndSwitch
EndIf
Case $Button1
_PicPreviewPrintSave(1) ; сохранение
Case $Button3
_PicPreviewPrintSave(0) ; предпросмотр
Case $Button2
_PicPreviewPrintSave(2) ; печать
EndSwitch
WEnd
Func _PicPreviewPrintSave($iK)
If $aPic[0] = '' Or $aPic[1] = '' Or $aPic[2] = '' Or $aPic[3] = '' Then Return MsgBox(262144 + 48, 'Ошибка', 'Загружены не все картинки!')
_GDIPlus_Startup()
$hSource1 = _GDIPlus_ImageLoadFromFile($aPic[0]); 1 картинка
$Size1 = _GDIPlus_GetImageDimension($hSource1)
$hSource2 = _GDIPlus_ImageLoadFromFile($aPic[1]); 2 картинка
$Size2 = _GDIPlus_GetImageDimension($hSource2)
$hSource3 = _GDIPlus_ImageLoadFromFile($aPic[2]); 3 картинка
$Size3 = _GDIPlus_GetImageDimension($hSource3)
$hSource4 = _GDIPlus_ImageLoadFromFile($aPic[3]); 4 картинка
$Size4 = _GDIPlus_GetImageDimension($hSource4)
If $Size1[0] + $Size2[0] > $Size3[0] + $Size4[0] Then
$iWidth = $Size1[0] + $Size2[0]
Else
Local $iWidth = $Size3[0] + $Size4[0]
EndIf
If $Size1[1] + $Size3[1] > $Size2[1] + $Size4[1] Then
Local $iHeight = $Size1[1] + $Size3[1]
Else
$iHeight = $Size2[1] + $Size4[1]
EndIf
$hDestination = _GDIPlus_CreateBitmapFromScan0($iWidth, $iHeight, 0, _GDIPlus_GetImagePixelFormat($hSource1))
$hGraphics = _GDIPlus_ImageGetGraphicsContext($hDestination)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hSource1, 0, 0, $Size1[0], $Size1[1])
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hSource2, $Size1[0], 0, $Size2[0], $Size2[1])
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hSource3, 0, $Size1[1], $Size3[0], $Size3[1])
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hSource4, $Size1[0], $Size3[1], $Size4[0], $Size4[1])
Switch $iK
Case 0
$hBMP = _GetImage($hDestination, 395, 250)
_hBmpToPicControl($PicPreview, $hBMP, 1)
Case 1
$var = FileSaveDialog('Выберите имя.', @ScriptDir, 'Рисунки (*.jpg)')
If Not @error Then _GDIPlus_ImageSaveToFile($hDestination, $var & '.jpg')
Case 2
_Print($hDestination)
EndSwitch
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_ImageDispose($hDestination)
_GDIPlus_ImageDispose($hSource1)
_GDIPlus_ImageDispose($hSource2)
_GDIPlus_ImageDispose($hSource3)
_GDIPlus_ImageDispose($hSource4)
_GDIPlus_Shutdown()
EndFunc ;==>_PicPreviewPrintSave
Func _Print($hBitmap)
; Create a printer device context
$s_PrinterName = _GetDefaultPrinter()
If $iPrinter = 1 Then $s_PrinterName = InputBox('Печать', 'Введите название принтера', $s_PrinterName)
If $s_PrinterName = '' Then Return SetError(0, 0, 0)
$hPrintDc = _WinAPI_CreateDC('winspool', $s_PrinterName)
; get pixel and twips info
$PixelsPerInchY = _WinAPI_GetDeviceCaps($hPrintDc, $__WINAPCONSTANT_LOGPIXELSY); Get Pixels Per Inch Y
$TwipsPerPixelY = 1440 / $PixelsPerInchY
$PixelsPerInchX = _WinAPI_GetDeviceCaps($hPrintDc, $__WINAPCONSTANT_LOGPIXELSX); Get Pixels Per Inch X
$TwipsPerPixelX = 1440 / $PixelsPerInchX
; get page width and height
$PageWidth = _WinAPI_GetDeviceCaps($hPrintDc, $HORZRES); Get width, in millimeters, of the physical screen
$PageHeight = _WinAPI_GetDeviceCaps($hPrintDc, $VERTRES); Get height, in millimeters, of the physical screen.
; set docinfo
$DocName = DllStructCreate('char DocName[' & StringLen($s_DocName & Chr(0)) & ']')
DllStructSetData($DocName, 'DocName', $s_DocName & Chr(0)); Size of DOCINFO structure
$DOCINFO = DllStructCreate($tagDOCINFO); Structure for Print Document info
DllStructSetData($DOCINFO, 'Size', 20); Size of DOCINFO structure
DllStructSetData($DOCINFO, 'DocName', DllStructGetPtr($DocName)); Set name of print job (Optional)
; start new print doc
$result = _WinAPI_StartDoc($hPrintDc, $DOCINFO)
; start new page
$result = _WinAPI_StartPage($hPrintDc)
$hGraphic = _GDIPlus_GraphicsCreateFromHDC($hPrintDc)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, $iX, $iY, $iW, $iH)
_GDIPlus_GraphicsDispose($hGraphic)
; End the page
$result = _WinAPI_EndPage($hPrintDc)
; End the print job
$result = _WinAPI_EndDoc($hPrintDc)
; Delete the printer device context
_WinAPI_DeleteDC($hPrintDc)
EndFunc ;==>_Print
Func _GetDefaultPrinter()
Local $szDefPrinterName
Local $Size
$namesize = DllStructCreate('dword')
DllCall('winspool.drv', 'int', 'GetDefaultPrinter', 'str', '', 'ptr', DllStructGetPtr($namesize))
$pname = DllStructCreate('char[' & DllStructGetData($namesize, 1) & ']')
DllCall('winspool.drv', 'int', 'GetDefaultPrinter', 'ptr', DllStructGetPtr($pname), 'ptr', DllStructGetPtr($namesize))
Return DllStructGetData($pname, 1);msgbox(0,dllstructgetdata($namesize,1),DllStructGetData($pname,1))
EndFunc ;==>_GetDefaultPrinter
Func _GetImage($hImage, $iWH, $iHH, $iBkClr = 0xFFFFFF)
Local $hBmp1, $hBitmap, $hGraphic, $iW, $iH, $aGS, $hBmp2
$hBmp1 = _WinAPI_CreateBitmap($iWH, $iHH, 1, 32)
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp1)
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_WinAPI_DeleteObject($hBmp1)
_GDIPlus_GraphicsClear($hGraphic, BitOR(0xFF000000, $iBkClr))
$iW = _GDIPlus_ImageGetWidth($hImage)
$iH = _GDIPlus_ImageGetHeight($hImage)
$aGS = _GetScaleNew($iW, $iH, $iWH, $iHH)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $aGS[0], $aGS[1], $aGS[2], $aGS[3])
_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hGraphic)
$hBmp2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_GDIPlus_BitmapDispose($hBitmap)
Return $hBmp2
EndFunc ;==>_GetImage
Func _GetScaleNew($iW, $iH, $iWH, $iHH)
Local $aRet[4]
If $iW = $iWH And $iH = $iHH Then
$aRet[2] = $iWH
$aRet[3] = $iHH
$aRet[0] = 0
$aRet[1] = 0
ElseIf $iW < $iWH And $iH < $iHH Then
$aRet[2] = $iW
$aRet[3] = $iH
$aRet[0] = ($iWH - $iW) / 2
$aRet[1] = 0
ElseIf $iW > $iWH Then
$aRet[2] = $iWH
$aRet[3] = ($iH / $iW) * $iWH
$aRet[0] = 0
$aRet[1] = 0
If $aRet[3] > $iHH Then
$aRet[2] = ($iW / $iH) * $iHH
$aRet[3] = $iHH
$aRet[0] = 0
$aRet[1] = 0
EndIf
ElseIf $iH > $iHH Then
$aRet[2] = ($iW / $iH) * $iHH
$aRet[3] = $iHH
$aRet[0] = 0
$aRet[1] = 0
EndIf
Return $aRet
EndFunc ;==>_GetScaleNew
Func _hBmpToPicControl($iCID, ByRef $hBMP, $iFlag = 0)
Local Const $STM_SETIMAGE = 0x0172
Local Const $IMAGE_BITMAP = 0
Local $hOldBmp
$hOldBmp = GUICtrlSendMsg($iCID, $STM_SETIMAGE, $IMAGE_BITMAP, $hBMP)
If $hOldBmp Then _WinAPI_DeleteObject($hOldBmp)
If $iFlag Then _WinAPI_DeleteObject($hBMP)
EndFunc ;==>_hBmpToPicControl
Func _GDIPlus_CreateBitmapFromScan0($iWidth, $iHeight, $iStride = 0, $iPixelFormat = 0x0026200A, $pScan0 = 0)
Local $Ret = DllCall($ghGDIPDll, 'uint', 'GdipCreateBitmapFromScan0', 'int', $iWidth, 'int', $iHeight, 'int', $iStride, 'int', $iPixelFormat, 'ptr', $pScan0, 'ptr*', 0)
If (@error) Or ($Ret[0]) Then
Return SetError(1, 0, 0)
EndIf
Return $Ret[6]
EndFunc ;==>_GDIPlus_CreateBitmapFromScan0
Func _GDIPlus_GetImageDimension($hImage)
Local $Ret = DllCall($ghGDIPDll, 'uint', 'GdipGetImageDimension', 'ptr', $hImage, 'float*', 0, 'float*', 0)
If (@error) Or ($Ret[0]) Then
Return SetError(1, 0, 0)
EndIf
Local $result[2]
$result[0] = $Ret[2]
$result[1] = $Ret[3]
Return $result
EndFunc ;==>_GDIPlus_GetImageDimension
Func _GDIPlus_GetImagePixelFormat($hImage)
Local $Ret = DllCall($ghGDIPDll, 'uint', 'GdipGetImagePixelFormat', 'ptr', $hImage, 'uint*', 0)
If (@error) Or ($Ret[0]) Then
Return SetError(1, 0, 0)
EndIf
Return $Ret[2]
EndFunc ;==>_GDIPlus_GetImagePixelFormat
; <PrintWinAPI.au3>
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_CreateDC
; Description ...: Creates a device context (DC) for a device using the specified name.
; Syntax.........: _WinAPI_CreateDC($sDriver, $sDevice)
; Parameters ....: $sDriver - Specifies driver name, "winspool" for printing, "display" for screen
; $sDevice - Specifies device name
; Return values .: Success - handle to a DC for the specified device
; ====================================================================================================
Func _WinAPI_CreateDC($sDriver, $sDevice)
Local $aResult
$aResult = DllCall("GDI32.dll", "hwnd", "CreateDC", "str", $sDriver, "str", $sDevice, "long", 0, "long", 0)
Return $aResult[0]
EndFunc ;==>_WinAPI_CreateDC
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_StartDoc
; Description ...: Starts a print job
; Syntax.........: _WinAPI_StartDoc($hDC, $tDocInfo)
; Parameters ....: $hDC - Identifies the device contex
; $tDocInfo - $tagDOCINFO structure that specifies document info
; Return values .: Success - print job identifier for the document
; ====================================================================================================
Func _WinAPI_StartDoc($hDC, $tDocInfo)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "StartDoc", "hwnd", $hDC, "ptr", DllStructGetPtr($tDocInfo))
Return $aResult[0]
EndFunc ;==>_WinAPI_StartDoc
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_EndDoc
; Description ...: Ends a print job
; Syntax.........: _WinAPI_EndDoc($hDC)
; Parameters ....: $hDC - Identifies the device contex
; Return values .: Success - return value greater than zero
; ====================================================================================================
Func _WinAPI_EndDoc($hDC)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "EndDoc", "hwnd", $hDC)
Return $aResult[0]
EndFunc ;==>_WinAPI_EndDoc
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_StartPage
; Description ...: Prepares the printer driver to accept data
; Syntax.........: _WinAPI_StartPage($hDC)
; Parameters ....: $hDC - Identifies the device contex
; Return values .: Success - return value greater than zero
; ====================================================================================================
Func _WinAPI_StartPage($hDC)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "StartPage", "hwnd", $hDC)
Return $aResult[0]
EndFunc ;==>_WinAPI_StartPage
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_EndPage
; Description ...: Notifies the device that the application has finished writing to a page
; Syntax.........: _WinAPI_EndPage($hDC)
; Parameters ....: $hDC - Identifies the device contex
; Return values .: Success - return value greater than zero
; ====================================================================================================
Func _WinAPI_EndPage($hDC)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "EndPage", "hwnd", $hDC)
Return $aResult[0]
EndFunc ;==>_WinAPI_EndPage
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_TextOut
; Description ...: Writes a character string at the specified location, using the currently selected font, background color, and text color
; Syntax.........: _WinAPI_TextOut($hDC, $iXStart, $iYStart, $sString)
; Parameters ....: $hDC - Identifies the device contex
; $iXStart - x-coordinate of starting position
; $iYStart - y-coordinate of starting position
; $sString - character string
; Return values .: Success - return value is nonzero
; ====================================================================================================
Func _WinAPI_TextOut($hDC, $iXStart, $iYStart, $sString = "")
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "TextOut", "hwnd", $hDC, "long", $iXStart, "long", $iYStart, "str", $sString, "long", StringLen($sString))
Return $aResult[0]
EndFunc ;==>_WinAPI_TextOut
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_CreatePen
; Description ...: Creates a logical pen that has the specified style, width, and color
; Syntax.........: _WinAPI_CreatePen($iPenStyle, $iWidth, $iColor)
; Parameters ....: $iPenStyle - specifies pen style
; $PS_SOLID = 0
; $PS_DASH = 1
; $PS_DOT = 2
; $PS_DASHDOT = 3
; $PS_DASHDOTDOT = 4
; $PS_NULL = 5
; $PS_INSIDEFRAME = 6
; $iWidth - width of the pen
; $iColor - pen color stated in RGB
; Return values .: Success - Handle to logical pen
; ====================================================================================================
;~ Func _WinAPI_CreatePen($iPenStyle = $PS_SOLID, $iWidth = 0, $iColor = 0x000000)
;~ Local $aResult
;~ $aResult = DllCall("GDI32.dll", "hwnd", "CreatePen", "int", $iPenStyle, "int", $iWidth, "dword", $iColor)
;~ Return $aResult[0]
;~ EndFunc ;==>_WinAPI_CreatePen
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_MoveToEx
; Description ...: Updates the current position to the specified point and optionally retrieves the previous position
; Syntax.........: _WinAPI_MoveToEx($hDC, $iX, $iY, $tPoint)
; Parameters ....: $hDC - Identifies the device contex
; $iX - x-coordinate of the new position, in logical units
; $iY - y-coordinate of the new position, in logical units
; $tPoint - $tagPOINT structure that receives the previous position
; Return values .: Success - non-zero value
; ====================================================================================================
Func _WinAPI_MoveToEx($hDC, $iX, $iY, ByRef $tPoint)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "MoveToEx", "long", $hDC, "int", $iX, "int", $iY, "ptr", DllStructGetPtr($tPoint))
Return $aResult[0]
EndFunc ;==>_WinAPI_MoveToEx
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_LineTo
; Description ...: Draws a line from the current position up to, but not including, the specified point
; Syntax.........: _WinAPI_LineTo($hDC, $iXEnd, $iYEnd)
; Parameters ....: $hDC - Identifies the device contex
; $iXEnd - x-coordinate, in logical units, of the endpoint of the line
; $iYEnd - y-coordinate, in logical units, of the endpoint of the line
; Return values .: Success - non-zero value
; ====================================================================================================
;~ Func _WinAPI_LineTo($hDC, $iXEnd, $iYEnd)
;~ Local $aResult
;~ $aResult = DllCall("GDI32.dll", "long", "LineTo", "long", $hDC, "int", $iXEnd, "int", $iYEnd)
;~ Return $aResult[0]
;~ EndFunc ;==>_WinAPI_LineTo
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_SetArcDirection
; Description ...: Sets the drawing direction to be used for arc and rectangle functions
; Syntax.........: _WinAPI_SetArcDirection($hDC, $Direction)
; Parameters ....: $hDC - Identifies the device contex
; $Direction - Specifies the new arc direction
; $AD_COUNTERCLOCKWISE = 1
; $AD_CLOCKWISE = 2
; Return values .: Success - old arc direction
; ====================================================================================================
Func _WinAPI_SetArcDirection($hDC, $Direction)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "SetArcDirection", "long", $hDC, "int", $Direction)
Return $aResult[0]
EndFunc ;==>_WinAPI_SetArcDirection
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_ArcTo
; Description ...: Draws an elliptical arc
; Syntax.........: _WinAPI_ArcTo($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect, $iXRadial1, $iYRadial1, $iXRadial2, $iYRadial2)
; Parameters ....: $hDC - Identifies the device contex
; $iLeftRect - x-coord of rectangle's upper-left corner
; $iTopRect - y-coord of rectangle's upper-left corner
; $iRightRect - x-coord of rectangle's lower-right corner
; $iBottomRect - y-coord of rectangle's lower-right corner
; $iXRadial1 - x-coord of first radial ending point
; $iYRadial1 - y-coord of first radial ending point
; $iXRadial2 - x-coord of second radial ending point
; $iYRadial2 - y-coord of second radial ending point
; Return values .: Success - return value is nonzero
; ====================================================================================================
Func _WinAPI_ArcTo($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect, $iXRadial1, $iYRadial1, $iXRadial2, $iYRadial2)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "ArcTo", "long", $hDC, "int", $iLeftRect, "int", $iTopRect, "int", $iRightRect, "int", $iBottomRect, "int", $iXRadial1, "int", $iYRadial1, "int", $iXRadial2, "int", $iYRadial2)
Return $aResult[0]
EndFunc ;==>_WinAPI_ArcTo
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_Arc
; Description ...: Draws an elliptical arc
; Syntax.........: _WinAPI_Arc($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect, $iXStartArc, $iYStartArc, $iXEndArc, $iYEndArc)
; Parameters ....: $hDC - Identifies the device contex
; $iLeftRect - x-coord of rectangle's upper-left corner
; $iTopRect - y-coord of rectangle's upper-left corner
; $iRightRect - x-coord of rectangle's lower-right corner
; $iBottomRect - y-coord of rectangle's lower-right corner
; $iXStartArc - x-coord of first radial ending point
; $iYStartArc - y-coord of first radial ending point
; $iXEndArc - x-coord of second radial ending point
; $iYEndArc - y-coord of second radial ending point
; Return values .: Success - return value is nonzero
; ====================================================================================================
Func _WinAPI_Arc($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect, $iXStartArc, $iYStartArc, $iXEndArc, $iYEndArc)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "Arc", "long", $hDC, "int", $iLeftRect, "int", $iTopRect, "int", $iRightRect, "int", $iBottomRect, "int", $iXStartArc, "int", $iYStartArc, "int", $iXEndArc, "int", $iYEndArc)
Return $aResult[0]
EndFunc ;==>_WinAPI_Arc
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_Rectangle
; Description ...: Draws a rectangle
; Syntax.........: _WinAPI_Rectangle($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect)
; Parameters ....: $hDC - Identifies the device contex
; $iLeftRect - x-coord of rectangle's upper-left corner
; $iTopRect - y-coord of rectangle's upper-left corner
; $iRightRect - x-coord of rectangle's lower-right corner
; $iBottomRect - y-coord of rectangle's lower-right corner
; Return values .: Success - return value is nonzero
; ====================================================================================================
Func _WinAPI_Rectangle($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "Rectangle", "long", $hDC, "int", $iLeftRect, "int", $iTopRect, "int", $iRightRect, "int", $iBottomRect)
Return $aResult[0]
EndFunc ;==>_WinAPI_Rectangle
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_RoundRect
; Description ...: Draws a rectangle
; Syntax.........: _WinAPI_RoundRect($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect, $iWidth, $iHeight)
; Parameters ....: $hDC - Identifies the device contex
; $iLeftRect - x-coord of rectangle's upper-left corner
; $iTopRect - y-coord of rectangle's upper-left corner
; $iRightRect - x-coord of rectangle's lower-right corner
; $iBottomRect - y-coord of rectangle's lower-right corner
; $iWidth - width of ellipse
; $iHeight - height of ellipse
; Return values .: Success - return value is nonzero
; ====================================================================================================
Func _WinAPI_RoundRect($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect, $iWidth, $iHeight)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "RoundRect", "long", $hDC, "int", $iLeftRect, "int", $iTopRect, "int", $iRightRect, "int", $iBottomRect, "int", $iWidth, "int", $iHeight)
Return $aResult[0]
EndFunc ;==>_WinAPI_RoundRect
; #FUNCTION# ====================================================================================================
; Name...........: _WinAPI_Ellipse
; Description ...: Draws a ellipse
; Syntax.........: _WinAPI_Ellipse($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect)
; Parameters ....: $hDC - Identifies the device contex
; $iLeftRect - x-coord of rectangle's upper-left corner of rectangle
; $iTopRect - y-coord of rectangle's upper-left corner of rectangle
; $iRightRect - x-coord of rectangle's lower-right corner of rectangle
; $iBottomRect - y-coord of rectangle's lower-right corner of rectangle
; Return values .: Success - return value is nonzero
; ====================================================================================================
Func _WinAPI_Ellipse($hDC, $iLeftRect, $iTopRect, $iRightRect, $iBottomRect)
Local $aResult
$aResult = DllCall("GDI32.dll", "long", "Ellipse", "long", $hDC, "int", $iLeftRect, "int", $iTopRect, "int", $iRightRect, "int", $iBottomRect)
Return $aResult[0]
EndFunc ;==>_WinAPI_Ellipse