xnelson,
I cannot figure out how to use your suggestion. Looking in my Help ==> Scripting Index I could not find your referenced "Help==>Scripting Index==>FrameBox==>Paste Background Image". I tried the following script made from my sample script and trying to apply your suggestion:
// Here's my original script:
win = New Window( "Map",
Graph Box(
Frame Size(600, 600),
X Scale(0, 1252),
Y Scale(0, 1252),
Pen Color("white"),
Line( {10, 10}, {10, 1200} );
Line( {600, 10}, {600, 1200} );
Line( {1200, 10}, {1200, 1200} );
)
);
// And here's what I added based on your suggestion:
opr1 = win << report;
fb1 = opr1[Frame Box( 1 )];
fb1 << Add Image(
Open(
Convert File Path(
"$SAMPLE_IMAGES/black rhino footprint.jpg"
)
),
Transparency( 0.9 ),
Rotate( 90 ),
Bounds(
Left( 0.135416666666667 ),
Right( 3.26041666666667 ),
Top( 11.8333333333333 ),
Bottom( -1 )
),
SetSize( {300, 210} )
);
When I run the script I get an error message saying:
"The display box 'EvalContextBox' does not recognize the message 'report'; perhaps you mean one of these: <<Set Report Title <<Reshow <<set horizontal <<get horizontal <<Parent <<Prepend <<Get RTF <<Save RTF <<Get Web Support <<Border <<Set Property <<Get Property <<Get Property List <<Get Properties <<Set Property <<Get Property <<Get Property List <<Get Properties."
I looked through the Scripting Index and found a reference to "report", but with syntax "y= Report( platform object)". So I tried replacing the line "opr1 = win << report;" with "opr1 = Report(win)". That got rid of the first error message, but now I get an error message "Send Expects Scriptable Object in access or evaluation of 'Send' , fb1 << /*###*/Add Image(".
I thought maybe I need to refer to the Graph Box itself instead of the New Window, so I tried the script:
win = New Window( "Map",
gb= Graph Box(
Frame Size(600, 600),
X Scale(0, 1252),
Y Scale(0, 1252),
Pen Color("white"),
Line( {10, 10}, {10, 1200} );
Line( {600, 10}, {600, 1200} );
Line( {1200, 10}, {1200, 1200} );
)
);
opr1 = Report( gb );
fb1 = opr1[Frame Box( 1 )];
fb1 << Add Image(
Open(
Convert File Path(
"$SAMPLE_IMAGES/black rhino footprint.jpg"
)
),
Transparency( 0.9 ),
Rotate( 90 ),
Bounds(
Left( 0.135416666666667 ),
Right( 3.26041666666667 ),
Top( 11.8333333333333 ),
Bottom( -1 )
),
SetSize( {300, 210} )
);
(Note I tried the syntax "opr1 = gb << report" first, but it gave me the original "report" error.) I still have a "Send Expects Scriptable Object in access or evaluation of 'Send' , fb1 << /*###*/Add Image(" error.
What am I doing wrong?
Also, is there a way to embed the image into the script? Multiple people will be running the script so a specific reference to an image location will not scale easily. For example, instead of using "Open" when I Add Image, can I use "Set Blob( Char To Blob())"?