CodeCarvings.Piczard
ConvertGraphicsUnitToGfxUnit Method
See Also  Send Feedback
CodeCarvings.Piczard Namespace > GfxUnitConverter Class : ConvertGraphicsUnitToGfxUnit Method

unit
The unit of measure to convert.
Converts a unit of measure used by the System.Drawing objects (GraphicsUnit) into the corresponding unit of measure used by Piczard (GfxUnit).

Syntax

Visual Basic (Declaration)  
Public Shared Function ConvertGraphicsUnitToGfxUnit( _
   ByVal unit As GraphicsUnit _
) As GfxUnit
C#  
public static GfxUnit ConvertGraphicsUnitToGfxUnit( 
   GraphicsUnit unit
)

Parameters

unit
The unit of measure to convert.

Return Value

The corresponding unit of measure.

Exceptions

Exception Description
System.Exception The unit of measure cannot be converted.

Remarks

If it's not possible to convert the unit of measure (for example "Display" is available only in the GraphicsUnit enumeration but not in GfxUnit) then an Exception is thrown.
In order to avoid that any Exception is thrown may be useful to invoke the GetCanConvertGraphicsUnitToGfxUnit method before invoking the ConvertGraphicsUnitToGfxUnit method.

Requirements

Platforms: Windows 8, Windows 7, Windows Vista, Windows XP Professional, Windows 2000 - Windows Server family: 2012, 2008.R2, 2008, 2003, 2000

See Also

©2013 Sergio Turolla. All Rights Reserved.