导航:  GdiPlus Classes > GdiPlus Classes > CGpCustomLineCap Class > AdjustableArrowCap Object >

SetFillState

上一页返回章节概述下一页

描述

 

设置箭头帽的填充状态.如果未填充箭头帽,则仅绘制轮廓.

 

C++ Syntax

 

Status SetFillState(

[in]  BOOL isFilled

);

 

FreeBASIC 语法

 

FUNCTION SetFillState ( _

   BYVAL bIsFilled AS BOOL _

) AS GpStatus

 

参数

 

isFilled

 

[in]布尔值,指定是否填充箭头帽.

 

返回值

 

如果该方法成功,则返回Ok,这是对Status枚举元素.

如果这个方法失败,它返回一个枚举的其他元素的Status.

 

引用文件

 

CGpLineCaps.inc (include CGdiPlus.inc)

 

示例

 

' ========================================================================================

' The following example creates an AdjustableArrowCap object, myArrow, and sets the fill

' mode to FALSE. The code then creates a Pen object and assigns myArrow as the ending

' line cap for this Pen object. Next, the code draws a line.

' ========================================================================================

SUB Example_SetFillState (BYVAL hdc AS HDC)

 

  ' // Create a graphics object from the window device context

  DIM graphics AS CGpGraphics = hdc

  ' // Get the DPI scaling ratio

  DIM rxRatio AS SINGLE = graphics.GetDpiX / 96

  ' // Set the scale transform

  graphics.ScaleTransform(rxRatio, rxRatio)

 

  ' // Create an AdjustableArrowCap with a height of 10 pixels

  ' // Fill state defaults to TRUE when arrow cap is constructed

  DIM myArrow AS CGpAdjustableArrowCap = CGpAdjustableArrowCap(10, 10)

  ' // Adjust to DPI by setting the scale width

  myArrow.SetWidthScale(rxRatio)

 

  ' // Set fill state to FALSE

  myArrow.SetFillState(FALSE)

 

  ' // Create a Pen, and assign myArrow as the end cap

  DIM arrowPen AS CGpPen = GDIP_ARGB(255, 0, 0, 0)

  arrowPen.SetCustomEndCap(@myArrow)

 

  ' // Draw a line using arrowPen

  graphics.DrawLine(@arrowPen, 0, 0, 100, 100)

 

END SUB

' ========================================================================================