Given a string, the font, fontstyle and fontsize how do i calculate the
rectangle that will hold it ?
thanks. 5 1487
"Karthik Seetharaman" <vz******@nospam.verizon.net> wrote in message
news:J1*******************@nwrddc01.gnilink.net... Given a string, the font, fontstyle and fontsize how do i calculate the rectangle that will hold it ?
Use the method 'Graphics.MeasureString', for a given graphics object
context.
"Karthik Seetharaman" <vz******@nospam.verizon.net> wrote in message
news:J1*******************@nwrddc01.gnilink.net... Given a string, the font, fontstyle and fontsize how do i calculate the rectangle that will hold it ?
Use the method 'Graphics.MeasureString', for a given graphics object
context.
hOSAM wrote: "Karthik Seetharaman" <vz******@nospam.verizon.net> wrote in message news:J1*******************@nwrddc01.gnilink.net...
Given a string, the font, fontstyle and fontsize how do i calculate the rectangle that will hold it ?
Use the method 'Graphics.MeasureString', for a given graphics object context.
Thanks. Can i figure out the font-size for a string given the
measurements where it is supposed to go ? I have a rectangular area the
width and height of which is fixed. I need t fit some strings in to that
area.
hOSAM wrote: "Karthik Seetharaman" <vz******@nospam.verizon.net> wrote in message news:J1*******************@nwrddc01.gnilink.net...
Given a string, the font, fontstyle and fontsize how do i calculate the rectangle that will hold it ?
Use the method 'Graphics.MeasureString', for a given graphics object context.
Thanks. Can i figure out the font-size for a string given the
measurements where it is supposed to go ? I have a rectangular area the
width and height of which is fixed. I need t fit some strings in to that
area.
Hello Karthik,
Check out the StringFormat class in GDI+ which can be used in DrawString
GDI+ function.
Regards,
Sujith.
"Karthik Seetharaman" <vz******@nospam.verizon.net> wrote in message
news:lB*******************@nwrddc02.gnilink.net... hOSAM wrote: "Karthik Seetharaman" <vz******@nospam.verizon.net> wrote in message news:J1*******************@nwrddc01.gnilink.net...
Given a string, the font, fontstyle and fontsize how do i calculate the rectangle that will hold it ?
Use the method 'Graphics.MeasureString', for a given graphics object context.
Thanks. Can i figure out the font-size for a string given the measurements where it is supposed to go ? I have a rectangular area the width and height of which is fixed. I need t fit some strings in to that area. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: pei_world |
last post by:
Hi there,
I have a problem about how to keep my draw graphics stay on my control
unless I delete them.
that means how to resist my graphics. also how to partially remove some
graphics from my...
|
by: David Sobey |
last post by:
Hi
I'm making a custom component using GDI+, a calendar grid thingy. I paint
the grid and numbers in my overrided OnPaint. However, when i go to paint
other things at other times in other...
|
by: Brian Basquille |
last post by:
Another question for ye all..
How do i check if a Region has entered another region?
Up until now, i've been checking if rectangles (or images converted into
Rectangles) have been visible in a...
|
by: |
last post by:
We create VC++ programs that does some GDI drawing functionality.
I discovered GDI+ and this seems to be a big step forward, and appears to be
standard available in Windows XP and Windows Server...
|
by: jack |
last post by:
In using GDI+ drawstring, if the string to be drawn is in
rtf format, how do I make GDI+ to recognize the rtf
attributes.
In other words, how do I draw one string in GDI+ , within
which the...
| |
by: lgbjr |
last post by:
Hello All,
I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If
the user wishes to open or edit an image, I need to save the image in the
picturebox to a temp file, then...
|
by: SStory |
last post by:
Question #1)
If I do Image.Save with the same filepath that I got the image from, it
bombs with "A generic error occurred in GDI+"
Any ideas? I prompt the user before overwriting, but if they...
|
by: davetelling |
last post by:
I am not a programmer, I'm an engineer trying to make an interface to a
product I'm designing. I have used C# to make a form that interrogates the
unit via the serial port and receives the data. I...
|
by: Chris Dunaway |
last post by:
When working with GDI+, calling the CreateGraphics method to draw on a
control has normally been frowned upon and it is always emphasized to
dispose of pens and brushes and other GDI objects lest...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |