Jump to content

Recommended Posts

Posted

How to split-get inputed text from input-edit control by pixels?

input control have length 400pixels, how to get from it 200pixels text?(not 200 characters)

Or convert pixels to characters and get number of characters?

Any idea?

 

Posted

How to split-get inputed text from input-edit control by pixels?

input control have length 400pixels, how to get from it 200pixels text?(not 200 characters)

Or convert pixels to characters and get number of characters?

Any idea?

I believe that font can make that very variable. Imprecise.

At least that, be defined.

Posted

You could get an approximation. Choose a fixed width font and based on the font size you choose, record the pixel width of a single character. Then just multiple the width by the length of your string.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...