Jump to content
Developer Wiki and Function Reference Links ×

function example


Recommended Posts

I am attempting to make an object that fills a page regardless of page size, TBB_GetPageArea reports dimensions that are a bit larger then what is set on page set up. what am I missing?

 

VAR 

{******Page Corners}
    PCTL, PCTR, PCBL, PCBR :point;
    
{********Layer Scale}
    rLScale : real;

{*******DrawingArea}
    outDrawingArea:string; outIsOther:boolean;  outIsOnePrintedPage:boolean; sDrawingArea:string;    

    TBTL,TBBR :point;
    rPageWidth, rPageHeight:real;
    rPageWPerc, rPageHPerc:real;
BEGIN;
    
{********************* Set Page Corner Locations ********************************}
    
    TBB_GetPageArea(ActLayer,rPageWidth,rPageHeight);
    rLScale := GetLScale(ActLayer);
    GetDrawingArea(outDrawingArea,outIsOther,outIsOnePrintedPage);
    


    PCTL.x:= (0-((rPageWidth/2)-.36)*rLScale);
    PCTL.y:= (((rPageHeight/2)-.36)*rLScale);
    PCTR.x:= (((rPageWidth/2)+.36)*rLScale);
    PCTR.y:= (((rPageHeight/2)-.36)*rLScale);
    PCBL.x:= ((0-(rPageWidth/2)+.36)*rLScale);
    PCBL.y:= ((0-(rPageHeight/2)+.36)*rLScale);
    PCBR.x:= ((rPageWidth/2)-.36)*rLScale;
    PCBR.y:= ((0-(rPageHeight/2)+.36)*rLScale);
{**********************************************************************}
(*    rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y);
    rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y);
*)


    rPageWPerc:=1/rPageWidth;
    rPageHPerc:=1/rPageHeight;
    TBTL.x:=rPageWidth-(rPageWidth*.1);    
    TBTL.y:=rPageHeight-(rPageHeight*.1);
    TBBR.x:=rPageWidth;
    TBBR.y:=rPageHeight;

    rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y);
    
    Message(concat(rPageWidth,' ',rPageHeight,' ',rLScale,' ',outDrawingArea));
END;
RUN(DrawToScale);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...