473,503 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Length to pixel transform

Hello everyone...
I have a question for all of you cause sincerelly I'm stuck.
I have a string and I can get its length.
For example : The string ASP. The length is 3.
How can I know how many pixels is the length.

Thanks a lot in advanced,

Mar 13 '06 #1
2 946

Pumkin wrote:
Hello everyone...
I have a question for all of you cause sincerelly I'm stuck.
I have a string and I can get its length.
For example : The string ASP. The length is 3.
How can I know how many pixels is the length.

Thanks a lot in advanced,

Take a look at the MeasureString method of the System.Drawing.Graphics
class - you give it a string and a font object, and it returns you a
size.

http://msdn.microsoft.com/library/de...ringtopic1.asp

Mar 13 '06 #2
you can only know the size on the server, you will have to render it on the
client, and use javascript to estimate the length (as the browser does not
expose and api for this).

-- bruce (sqlwork.com)
"Pumkin" <Po********@gmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
Hello everyone...
I have a question for all of you cause sincerelly I'm stuck.
I have a string and I can get its length.
For example : The string ASP. The length is 3.
How can I know how many pixels is the length.

Thanks a lot in advanced,

Mar 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1144
by: Coco | last post by:
can i transform fixed length text to xml using XSL do i have to first load the text to xml and do the transformation? is there any other way to do it?
1
10030
by: Valerie Hough | last post by:
I have an object derived from Control and I place an icon in it during Paint handler. I now want to get the color of a particular pixel in my control. In C++ I could use CDC::GetPixel(x,y). Is...
1
5266
by: gane kol | last post by:
Hi I am using DES algorithm. I am getting an error message in a few cases of the querystring Error Message : Length of the data to decrypt is invalid. Error Method : System.String...
7
17858
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
1
6976
by: Jim Carlock | last post by:
If I'm putting together a list of links and I want to get add each item one at a time inside a foreach($aNames as $sName) loop, is there an easy way to get the number of pixels that the $aName...
11
786
by: cc | last post by:
Hi, From a C# application am I writing some text in a Word.Table, in a Cell of the Table to be more precise. The cell has a certain width and any string written in the cell will cover one or...
30
9015
by: Chaos | last post by:
As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes...
7
6397
by: teo | last post by:
Hallo, I'd like to retrieve the pixel length of a string. ------------------------ I decided to use MeasureString, but I have a problem with the graphic "instance" of it. I'm in a Sub and
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6998
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...
0
7464
tracyyun
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...
1
5018
isladogs
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...
0
3171
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...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
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 ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.