Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resizing problems

Status
Not open for further replies.

yeller2

Programmer
Feb 8, 2007
69
US
I have a label inside of a picturebox. I want to resize both so that the end result is the exact same look only bigger/smaller. When using the same percentage - I seem to go a pixel or so off sometimes - I can tell because I have text on the picturebox.image. This only seems to occur though when I try to go smaller. Any ideas?
 
How are you sizing the label?
Do you have the anchor properties set or are you doing the resizing via code (with your own formula)

If you are resizing yourself then chances are you have a rounding error. Come to think of it, even if you're using a MS control, it may still have a rounding error :)


Do all of your calculations as double's or float's and then cast to integer at the very end for the most precise scaling possible.

 
I've gotten the formula down to the best I feel it can possible be - I do round everything - thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top