ReminderVDP Posted January 4, 2021 Share Posted January 4, 2021 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); Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted January 5, 2021 Share Posted January 5, 2021 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 Quote Link to comment Share on other sites More sharing options...
ReminderVDP Posted January 5, 2021 Author Share Posted January 5, 2021 Thanks Jon. Once again, I over complicate my rules. That seems to work but it's moving the frame for every image not just one's that contain IC in the file name. I think this will work if I can just narrow the file name issue down in the rule. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 5, 2021 Share Posted January 5, 2021 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. Quote Link to comment Share on other sites More sharing options...
psmosser Posted August 24, 2023 Share Posted August 24, 2023 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? Appreciate any guidance you can offer! Thanks, Shannon Quote Link to comment Share on other sites More sharing options...
psmosser Posted August 24, 2023 Share Posted August 24, 2023 I've managed to move it to a specific x position with this in onRecordStart FindGraphicFrame("QR Code Front-001").x =Field("Xposition") I'm not sure how to string the Y position into the rule though. Quote Link to comment Share on other sites More sharing options...
psmosser Posted August 24, 2023 Share Posted August 24, 2023 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"); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 24, 2023 Share Posted August 24, 2023 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"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.