Zoom in on a label without changing the font size [modified]
-
Hi there, I need to be able to zoom in on a label without changing the text size (i.e. feed it a zoom factor, such as 2, and have it enlarge on the screen by that amount). Basically, a series of labels are part of a component used to set text sizes/layouts on a page. The component needs 'zoom' capability - e.g. zoom to 2x magnification. Clearly, changing the text size would be easy, but this means when the page is saved, the text sizes would have to be changed back ('rescaled') to zoom 1x, which seems awfully messy (esp if the user wants to edit the text size while it's zoomed). Is there an easier/less bothersome way? These do not *HAVE* to be labels, if a solution exists for a similar control (they could be, e.g. uneditable textboxes)... any help would be greatly appreciated :) thanks Lee EDIT: I ended up simply having to change the text size, in the 'messy' fashion I described above. It wasn't ideal, but did the job.
modified on Thursday, February 17, 2011 9:08 PM
-
Hi there, I need to be able to zoom in on a label without changing the text size (i.e. feed it a zoom factor, such as 2, and have it enlarge on the screen by that amount). Basically, a series of labels are part of a component used to set text sizes/layouts on a page. The component needs 'zoom' capability - e.g. zoom to 2x magnification. Clearly, changing the text size would be easy, but this means when the page is saved, the text sizes would have to be changed back ('rescaled') to zoom 1x, which seems awfully messy (esp if the user wants to edit the text size while it's zoomed). Is there an easier/less bothersome way? These do not *HAVE* to be labels, if a solution exists for a similar control (they could be, e.g. uneditable textboxes)... any help would be greatly appreciated :) thanks Lee EDIT: I ended up simply having to change the text size, in the 'messy' fashion I described above. It wasn't ideal, but did the job.
modified on Thursday, February 17, 2011 9:08 PM
The only thing that springs to mind is to have a 'dummy' control that overlies the 'real' one and does all the zooming when anything other than 1x is selected.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus!
-
Hi there, I need to be able to zoom in on a label without changing the text size (i.e. feed it a zoom factor, such as 2, and have it enlarge on the screen by that amount). Basically, a series of labels are part of a component used to set text sizes/layouts on a page. The component needs 'zoom' capability - e.g. zoom to 2x magnification. Clearly, changing the text size would be easy, but this means when the page is saved, the text sizes would have to be changed back ('rescaled') to zoom 1x, which seems awfully messy (esp if the user wants to edit the text size while it's zoomed). Is there an easier/less bothersome way? These do not *HAVE* to be labels, if a solution exists for a similar control (they could be, e.g. uneditable textboxes)... any help would be greatly appreciated :) thanks Lee EDIT: I ended up simply having to change the text size, in the 'messy' fashion I described above. It wasn't ideal, but did the job.
modified on Thursday, February 17, 2011 9:08 PM
If you are using WPF you can use an Animation, which will take care of restoring the original value when the animation ends (provided you configure it correctly). Otherwise you could create a disposable helper class that can animate a property value, including storing the original value and restoring it at the end.