![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to create a form with up to 100 text boxes or labels. Don't care which I use as the data will be static. I will have a table that gives the top and left position, the maximum height & width and the angle as well as the ControSource or Caption. The size of the label needs to be adjusted to the size of the data it contains. Stephen Leban's has a couple of routines to help with that, but his rotation routines apparently are very hungry with memory. Any idea please? Phil |
#3
| |||
| |||
|
|
On Mar 4, 6:56*pm, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote: I need to create a form with up to 100 text boxes or labels. Don't care w hich I use as the data will be static. I will have a table that gives the top and left position, the maximum height & width and the angle as well as the ControSource or Caption. The size of the label needs to be adjusted to th e size of the data it contains. Stephen Leban's has a couple of routines to help with that, but his rotation routines apparently are very hungry with memory. Any idea please? Phil Two options come to mind: 1) Create a XAML file from Access and show your form in a browser 2) Create a PDF file from Access and show your form in Acrobat Reader. It should be a piece of cake for either. Both support vector graphics and transformations. The transformations were quite easy for me to learn because the same technique was used in an XWindows course I took before PDF files were even conceived. Some techniques have been around longer than most people realize :-). The WPF book I have shows much of what XAML can do: WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 Wiley/Wrox 2010 Rod Stephens ISBN: 978-0-470-47722-9 Don't let the C# part scare you. The preponderance of examples are just XAML. For PDF output, to get the width in points that a particular string will have for a given font and font size, you'll need to use font metrics information. I usually put the character widths (usually expressed as a number of thousandths for Adobe fonts) for commonly used fonts into an Access table and have a function calculate the string width. If the string width is too large to fit in the allotted space, I can use the point size of the allotted space to scale down the font size proportionately if space is at a premium since decimal font sizes such as 7.325 are allowed :-). Note that Stephen Lebans simply used API functions to get his string widths since his examples were limited to the Windows environment. I try to limit how much text resizing is done (and to what degree, zoom notwithstanding) since the aesthetics can suffer if you have a lot of different sized fonts all over your output. If you use a monospaced font such as Courier, the metrics are easy, but font scaling might make it look like you are using different sized typewriters for the non-fixed portion of your output :-). Rotating text involves setting a new origin and then rotating the coordinates. Then put out text normally. It's good to do your text rotating inside a 'q' ... 'Q' block since PDF graphics commands can become embarrassing if you don't scope your coordinate transformations. James A. Fortune CDMAPoster (AT) FortuneJames (DOT) com Thanks James |
![]() |
| Thread Tools | |
| Display Modes | |
| |