Assume that 1 logical unit = 1 device unit,
and I have "Gdiplus::Font( lpwszFontName, (REAL)iFontSize )",
Then how can I get the size of a text with that font without creating
Graphics object? It doesn't need to be very exact size.
Because, MeasureString() method of GDI+ requires Graphics object to be
created first. That method is member of Graphics object.
An option if you have a DC:
http://msdn.microsoft.com/en-us/library/a6x7y2a4(VS.80).aspx
Check out DT_CALCRECT in the remarks. By calling this with the text you
want measured, you should get the results you're after.
This is a device-dependent calculation. You can't do a device-dependent
calculation without a device.
You can "Assume that 1 logical unit = 1 device unit" but the system cannot.
Why are you against creating a Graphics object?
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
Thanks for your help!