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 11:38:46 AM - -184.108.40.206
Click to read this page
4/6/2008 1:23:14 PM - 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 11:00:13 AM - Damon Carr-220.127.116.11
Please edit this page!
Do you have...