[]
        
(Showing Draft Content)

C1.Win.Document.Utils

Utils Class

Contains common functions.

Inheritance
Utils
Namespace: C1.Win.Document
Assembly: C1.Win.Document.10.dll
Syntax
public static class Utils : Object
Public Module Utils
    Inherits Object

Methods

Name Description
CopyStream(Stream, Stream)

Copies content of one stream to another.

GetDcDpi(IntPtr)

Gets the resolution for the specified device context.

GetScreenLogicalDpi(out float, out float)
GetSystemResolutionScaleFactors(out float, out float)

Returns the current scale factor for system resolution regarding to default 96 dpi. For example, if system dpi is 120 then 1.25 will be returned.

IImageFromObjectWin(object)

Converts an object to a GrapeCity.Documents.Drawing.IImage instance if possible.

ReadMetafileFromMemory(byte[])

Reads a System.Drawing.Imaging.Metafile from a byte array.

SamePaperSizes(Size, Size)

Tests two sizes for equality allowing a small margin for rounding errors.

Swap<T>(ref T, ref T)

Swaps two values.

ToC1UtilFont(Font)
ToSysImage(IImage)
ToSystemFont(Font)
TryColorFromString(string, CultureInfo, out Color)

This method is based on ColorConverter.ConvertFrom(...) method from WinForms.

ValueToString(object)

Converts value to string, returns "NULL" if value is null, otherwise returns string in format: "value.ToString()(value.GetType().FullName)".

WriteImageToFile(Image, ImageFormat, string)

Writes specified image to file.

WriteImageToStream(Image, ImageFormat, Stream)

Writes specified image to stream.

WriteMetafileToFile(Metafile, string)

Serializes a System.Drawing.Imaging.Metafile to a disk file.

WriteMetafileToMemory(Metafile)

Writes a System.Drawing.Imaging.Metafile to a byte array.

WriteMetafileToStream(Metafile, Stream)

Serializes a System.Drawing.Imaging.Metafile to a System.IO.Stream.