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

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

Syntax

Visual Basic (Declaration)  
Public Shared Function ConvertGfxUnitToGraphicsUnit( _
   ByVal unit As GfxUnit _
) As GraphicsUnit
C#  
public static GraphicsUnit ConvertGfxUnitToGraphicsUnit( 
   GfxUnit 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 "Centimeter" is available only in the GfxUnit enumeration but not in GraphicsUnit) then an Exception is thrown.
In order to avoid that any Exception is thrown may be useful to invoke the GetCanConvertGfxUnitToGraphicsUnit method before invoking the ConvertGfxUnitToGraphicsUnit 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.