Jump to content

Moving Frames


Recommended Posts

Two questions. Is there a way to move image frames based on a data field condition? I've found a few things to try and move them based on x and y coordinates but they just send the image up to the upper left corner instead of the coordinates I specified. Below is my current OnRecordStart rule. I'm trying to move the image frame up about 3/8" based off the file type.

 

Do I just have the syntax wrong even though the rule validates?

var myFrame = FindGraphicFrame("FC-AgentPhoto");

if  (Field("AgentCoverPic").indexOf("IC"));
return ResizeFrame("FC-AgentPhoto",  myFrame.x = 29.304, myFrame.y = 501.048);

Link to comment
Share on other sites

ReminderVDP,

If you only want to move a frame you have to find it and then you can get the .x or the .y and subtract or add the amount you want to move. The measurements are in 100th of a point. You still need it in your OnRecordStart rule.

 

You can try this:

 

if (Field("AgentCoverPic").indexOf("IC"));

FindGraphicFrame("FC-AgentPhoto").x = FindGraphicFrame("FC-AgentPhoto").x - (.375*7200); //The measurements are in 100th of a point

 

Jon

Link to comment
Share on other sites

Try this:

if (Field("AgentCoverPic").indexOf("IC") > -1)
   FindGraphicFrame("FC-AgentPhoto").y -= 7200 * 3/8;

Or:

if (Field("AgentCoverPic").match("IC"))
   FindGraphicFrame("FC-AgentPhoto").y -= HundredthsOfPointsFromText("0.375 in");

Or you could just have a second frame at the other position, and have the rule select which of the two frames to populate with the variableName property or SetVariable() function, or populate them both and suppress one.

Link to comment
Share on other sites

  • 2 years later...

Dan,

I'm back to working on this issue with a different graphic. I have your example working to find and move the graphic from above. 

FindGraphicFrame("QR Code Front-001").y -= HundredthsOfPointsFromText("1.375 in");

What I need to do next is to move a the frame to a specific location based on data in a field for the "X" and "Y" coordinates.

Something like below but I can put whatever measurement data there that I need, I'm just not sure what it is. Can I move the box to a specific location based on data or do I need to shift it from it's original location based on that data? For example, can I say place it at 1" X and 1" Y or do I need to instruct it to move whatever amount that is from it's current location? In either case, what's the syntax to get the measurement from the data file? 

image.png.29c38359207b8817894987d1ff8038ac.png

Appreciate any guidance you can offer! 

 

Thanks,


Shannon

 

Link to comment
Share on other sites

Solved it. This seems to work if anyone else needs it. 

 

FindGraphicFrame("QR Code Front-001").x =Field("Xposition"), FindGraphicFrame("QR Code Front-001").y =Field("yposition"), FindGraphicFrame("QR Code Front-001").width =Field("Xsize"), FindGraphicFrame("QR Code Front-001").height =Field("Ysize");

 

 

Link to comment
Share on other sites

 

52 minutes ago, psmosser said:

Solved it. This seems to work if anyone else needs it. 

 

FindGraphicFrame("QR Code Front-001").x =Field("Xposition"), FindGraphicFrame("QR Code Front-001").y =Field("yposition"), FindGraphicFrame("QR Code Front-001").width =Field("Xsize"), FindGraphicFrame("QR Code Front-001").height =Field("Ysize");

 

 

Sure, but you don't have to keep calling FindGraphicFrame over and over.  You can put the result of that into a variable, like so:
 

var frame = FindGraphicFrame("QR Code Front-001");
frame.x = Field("Xposition");
frame.y = Field("yposition");
frame.width = Field("Xsize");
frame.height = Field("Ysize");

 

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...