Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GdiPlusX and TextMetrics
Message
From
25/02/2008 15:59:53
 
 
To
25/02/2008 15:53:41
General information
Forum:
Visual FoxPro
Category:
VFPX/Sedna
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01296206
Message ID:
01296218
Views:
10
Sergio,

MeasureString has some limitations...
Unfortunately, it does not provide a super accurate result...

I hope to send you a new sample with a more accurate measurement soon



>Hi Cesar :)
>
>This is exactly what I was looking for I think
>
>BTW on that blog example, yelow rectangle is litle bit bigger then text.
>I need surrounding rectangle exactly along string boundaries.
>
>It seem that I have to find out everything about that 'xfcSize' from GdiPlusX :)
>
>Thks+++
>Sergio
>
>>Hi Sergio,
>>
>>In GdiPlusX, you can use the MeasureString in the xfcGraphics class.
>>
>>You may check this blog post for a sample using it:
>>http://weblogs.foxite.com/cesarchalom/archive/2007/11/24/5428.aspx
>>
>>Regards
>>
>>Cesar
>>
>>
>>
>>>Hi All
>>>
>>>I was looking at textmetric topic on MSDN. Is this structure/functionality covered in any part of GdiPlusX ?
>>>Reason asking;
>>>I need precise coordinates of string as it is drawn on Canvas.
>>>
>>>If I draw string 'GDIPlusX Rocks!' at pixel 0,0 using Arial 16 / bold,
>>>I want to know exactly what will be coordinates of bottom left and bottom-right pixels of hypotetic rectangle that string is drawn within.
>>>(Like 'loPathRect' when you draw justified string/text)
>>>
>>>
>>>.
>>>.
>>>* Create Font Object
>>>local loFont as xfcFont
>>>loFont = .font.New('Arial', 16 , .FontStyle.Bold )
>>>oGfx.DrawString( 'GdiPlusX Rocks big time! :)' , loFont, loSolidBrush, .PointF.New( 0,0))
>>>.
>>>.
>>>
>>>Also, How meny pixels are above letters, how meny pixels are below baseline.
>>>
>>>FONTMETRIC() give static info in regard of fonts, but I was wandering if GdiPlusX has provisions for obtaining this kind of 'as you draw' or 'on the fly' coordinates.
>>>
>>>TIA
>>>Sergio
>>>
>>>
>>>
>>>
>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform