PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Sep 22, 2019 3:47 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: bounding rect of text
PostPosted: Thu Dec 08, 2016 3:13 pm 
Offline

Joined: Wed Jul 09, 2008 3:52 pm
Posts: 3
hello,

sorry for my bad english :?

How can i get a bounding rectangle of a drawing text?

Code:
gfx.DrawString("test", New XFont("Arial", textSize, XFontStyle.Regular), XBrushes.Black, x, y)
dim rect as new xRect(x,y, ???textwidth???, ???textheight???)


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 08, 2016 3:15 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2968
Location: Cologne, Germany
Hi!

Use gfx.MeasureString(...).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 08, 2016 3:27 pm 
Offline

Joined: Wed Jul 09, 2008 3:52 pm
Posts: 3
oh... so easy :D

thanks


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group