描述
返回一个值,该值指示此对象最近的方法失败的性质.
C++ Syntax
Status GetLastStatus(); |
FreeBASIC 语法
FUNCTION GetLastStatus () AS GpStatus |
参数
该方法没有参数.
返回值
的GetLastStatus方法返回的Status枚举元素.
如果没有对这个对象调用的方法都失败了因为GetLastStatus以前的电话,然后GetLastStatus返回OK.
如果至少有一个方法在图像对象调用失败,因为GetLastStatus以前的电话,然后GetLastStatus返回一个值,表示最近的故障性质.
引用文件
CGpFontFamily.inc (include CGdiPlus.inc)
示例
' ========================================================================================
' The following example creates a FontFamily object and then checks the status of the call
' to create the object. If the call was successful, the example draws text.
' ========================================================================================
SUB Example_GetLastStatus (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
DIM ryRatio AS SINGLE = graphics.GetDpiY / 96
' // Set the scale transform
graphics.ScaleTransform(rxRatio, ryRatio)
' // Create a FontFamily object
DIM myFontFamily AS CGpFontFamily = "arial"
' // Check the status of the last call.
DIM status AS GpStatus = myFontFamily.GetLastStatus
' // If the last call succeeded, draw text.
IF status = Ok THEN
DIM solidBrush AS CGpSolidBrush = GDIP_ARGB(255, 0, 0, 0)
DIM font AS CGpFont = CGpFont(@myFontFamily, AfxPointsToPixelsX(16) / rxRatio)
graphics.DrawString("status = ok", -1, @font, 0, 0, @solidbrush)
END IF
END SUB
' ========================================================================================


