Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Can the HTML Report display a specified X by Y section of a Frame as an image?

I have a rather large frame containing numerous objects and sub-frames.  Using [current,*] will provide a scaled image of the frame in the HTML report.  This makes a nice (too small to read) thumbnail good for the HTML report and printing.  However, there are sections within the frame I would like to "zoom in" on and display in the HTML report.  

I know I can force the entire image size by modifying the object parameters like [current,"caption",400,175].  This of course creates a very large image in the HTML report so the frame details can be read.  As a consequence, this large displayed image does not make the HTML report flow or print well.

Is there any way to specify x by y specific coordinates and/or crop the frame image that then could be displayed in the HTML report?

3 REPLIES
Solution
Solution
Accepted by topic author bojo
‎09-28-2016 07:20 AM

Betreff: Can the HTML Report display a specified X by Y section of a Frame as an image?

Hi Bojo,

 

maybe there is a more elegant/direct solution, but I can only think of a small workaround:

  1. Take a "screenshot" of your model-network to the clipboard (you can set x0,y0 and width/height there)
  2. Paste it as a network icon
  3. Display the network icon in the HTML-report

I created a network called "ScreenshotFrame" and added an icon "ScreenshotIcon" to it. I used this in the HTML report:

[!ScreenshotFrame, "ScreenshotIcon", "A network icon showing a model screenshot from (x0,y0)..(x1,y1)", 100%]

 

Then I created an endsim method and entered this:

is
	sLastCurrIcon	: string;
do
	-- grab a screenshot of a network from (x0,y0)..(x1,y1)
	root.copyBitmapToClipboard(100,200, 200,80);
	
	-- remember the current icon of ScreenshotFrame
	sLastCurrIcon				:= ScreenshotFrame.currIcon;
	
	-- paste the screenshot into the icon "ScreenshotIcon"
	ScreenshotFrame.setCurrIconFromClipboard("ScreenshotIcon");
	
	-- [optional]: restore the old current icon (to prevent that the screenshot is displayed in the model network)
	ScreenshotFrame.currIcon	:= sLastCurrIcon;
	
	-- display the HTML-report
	HTMLReport.show;
end;

 

See also the attached example model.
But maybe another expert also knows of a direct solution, who knows Smiley Happy

 

Regards,
Alex

____________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!
This answered your question? Please mark it as "Accepted Solution", thank you!

Betreff: Can the HTML Report display a specified X by Y section of a Frame as an image?

There is no direct way of specifying an area which should be shown in the HTML report. But the solution suggested by Alex is an excellent work-around.

Regards,

Ralf

Betreff: Can the HTML Report display a specified X by Y section of a Frame as an image?

Thank you both Alex and Ralf for your responses. I was able to incorporate the work-around Alex proposed. As far as I am concerned this was a very slick, if not "elegant", solution. Thank you again.
-B