Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SetDocSize Example (Read 1516 times)
Exo
YaBB Newbies
*
Offline



Posts: 7
Joined: Aug 5th, 2008
SetDocSize Example
Aug 22nd, 2008 at 3:45pm
Print Post  
Hi,

Can anyone give me a quick example of some VB6 code that will set the size of the diagram area.
I would like to give my users the option of selecting say A4 and then the drawing area will be sized to an A4 sheet.
I just can't seem to work out the correct way of using the SetDocSize property.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SetDocSize Example
Reply #1 - Aug 25th, 2008 at 10:29am
Print Post  
Hi,

That should do it:

Code
Select All
fcx.MeasureUnit = uPoint

Dim A4WidthInMM As Single
Dim A4HeightInMM As Single
Dim A4WidthInPoints As Single
Dim A4HeightInPoints As Single

A4WidthInMM = 210
A4HeightInMM = 297

A4WidthInPoints = A4WidthInMM / 25.4 * 72
A4HeightInPoints = A4HeightInMM / 25.4 * 72

fcx.SetDocSize 0, 0, A4WidthInPoints, A4HeightInPoints
 



Here MeasureUnit is set to Point, because the A4 size would be hard to calculate in pixels - you would have to consider the graphics adapter's DPI settings.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint