Smart Device Functions:
Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than gdi32, prefix the name with the module name and a period.
Tips & Tricks:
static extern bool GetTextExtentPoint32(IntPtr hdc, string lpString,
int cbString, out SIZE lpSize);
// the GDI class contains static "gdi32.dll" calls
public Size getExtent(string text, Graphics graphics, Font font)
Size sz = Size.Empty;
Alternative Managed API:
If you are using GDI+ with a Graphics object you can make use of the following code sample:
using System.Windows.Forms; // for TextRenderer
Since .NET padding has been added to font's height and width. So you need to make use of the format flag TextFormatFlags.NoPadding to get the real size of the text.
g - is the Graphics object you want to draw on
For more information see
Good luck and have fun (Julian Taupe)
The GetTextExtentPoint32 API
3/3/2011 4:38:46 AM - -188.8.131.52
Click to read this page
4/6/2008 7:23:14 AM - anonymous
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-184.108.40.206
Please edit this page!
Do you have...