I want to call native gdi+ method to improve performance of text drawing. Can anyone provide example? I found the following code from reference source. I want to use this method in C# to improve the performance. How can i achieve this?
[DllImport(ExternDll.Gdiplus, SetLastError=true, ExactSpelling=true,
CharSet = System.Runtime.InteropServices.CharSet.Unicode)] // 3 = Unicode
[ResourceExposure(ResourceScope.None)]
internal static extern int GdipDrawString(HandleRef graphics,
string textString, int length, HandleRef font,
ref GPRECTF layoutRect, HandleRef stringFormat, HandleRef brush);
I don't know how to create object for HandleRef
class. Please suggest me on this?
At present am using following code to draw the string.
Graphics.DrawString(text, font, brush, rect, format);