Sets the start cap for a Pen object
#include <GDIPlus.au3>
_GDIPlus_PenSetStartCap ( $hPen, $iLineCap )
$hPen | Pointer to a Pen object |
$iLineCap | Line cap style: 0x00 - Line ends at the last point. The end is squared off 0x01 - Square cap. The center of the square is the last point in the line. The height and width of the square are the line width. 0x02 - Circular cap. The center of the circle is the last point in the line. The diameter of the circle is the line width. 0x03 - Triangular cap. The base of the triangle is the last point in the line. The base of the triangle is the line width. 0x10 - Line ends are not anchored. 0x11 - Line ends are anchored with a square. The center of the square is the last point in the line. The height and width of the square are the line width. 0x12 - Line ends are anchored with a circle. The center of the circle is at the last point in the line. The circle is wider than the line. 0x13 - Line ends are anchored with a diamond (a square turned at 45 degrees). The center of the diamond is at the last point in the line. The diamond is wider than the line. 0x14 - Line ends are anchored with arrowheads. The arrowhead point is located at the last point in the line. The arrowhead is wider than the line. 0xff - Line ends are made from a CustomLineCap object. |
Success: | True. |
Failure: | False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3). |
Search GdipSetPenStartCap in MSDN Library.
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $hGUI, $hGraphic, $hPen
; Create GUI
$hGUI = GUICreate("GDI+", 400, 400)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing)
_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
$hPen = _GDIPlus_PenCreate(0xFFAA00FF, 40)
_GDIPlus_PenSetStartCap($hPen, $GDIP_LINECAPROUND)
_GDIPlus_PenSetEndCap($hPen, $GDIP_LINECAPROUND)
_GDIPlus_GraphicsDrawArc($hGraphic, 60, 60, 280, 280, 135, 270, $hPen)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>Example