Class GdiInterop
- Namespace
- SharpDX.DirectWrite
- Assembly
- SharpDX.Direct2D1.dll
[Guid("1edd9491-9853-4299-898f-6432983b6f3a")]
public class GdiInterop : ComObject
- Inheritance
-
GdiInterop
- Derived
Constructors
GdiInterop(nint)
public GdiInterop(nint nativePtr)
Parameters
nativePtr
nint
Methods
CreateBitmapRenderTarget(nint, int, int)
Creates an object that encapsulates a bitmap and memory DC (device context) which can be used for rendering glyphs.
public BitmapRenderTarget CreateBitmapRenderTarget(nint hdc, int width, int height)
Parameters
hdc
nintA handle to the optional device context used to create a compatible memory DC (device context).
width
intThe width of the bitmap render target.
height
intThe height of the bitmap render target.
Returns
- BitmapRenderTarget
When this method returns, contains an address of a reference to the newly created BitmapRenderTarget object.
CreateFontFaceFromHdc(nint)
public FontFace CreateFontFaceFromHdc(nint hdc)
Parameters
hdc
nintA handle to a device context into which a font has been selected. It is assumed that the client has already performed font mapping and that the font selected into the device context is the actual font to be used for rendering glyphs.
Returns
- FontFace
Contains an address of a reference to the newly created font face object, or
null
in case of failure. The font face returned is guaranteed to reference the same physical typeface that would be used for drawing glyphs (but not necessarily characters) using ExtTextOut.
Remarks
This function is intended for scenarios in which an application wants to use GDI and Uniscribe 1.x for text layout and shaping, but DirectWrite for final rendering. This function assumes the client is performing text output using glyph indexes.
FromLogFont(object)
Creates a font object that matches the properties specified by the LOGFONT structure.
public Font FromLogFont(object logFont)
Parameters
logFont
objectA structure containing a GDI-compatible font description.
Returns
ToLogFont(Font, object)
Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
public bool ToLogFont(Font font, object logFont)
Parameters
font
FontAn Font object to be converted into a GDI-compatible LOGFONT structure.
logFont
objectWhen this method returns, contains a structure that receives a GDI-compatible font description.
Returns
- bool
TRUE if the specified font object is part of the system font collection; otherwise, FALSE.
Remarks
The conversion to a LOGFONT by using ConvertFontToLOGFONT operates at the logical font level and does not guarantee that it will map to a specific physical font. It is not guaranteed that GDI will select the same physical font for displaying text formatted by a LOGFONT as the Font object that was converted.
Operators
explicit operator GdiInterop(nint)
public static explicit operator GdiInterop(nint nativePtr)
Parameters
nativePtr
nint