Screenshot tool with 'Cross hair'

Maybe cross hair isn’t the right term, but what I am looking to do is make a tool that puts a rectangle in the middle of the model view that I can pan my model around until it is in the right spot inside of the rectangle, and then take a screenshot of only what is inside of that rectangle. Any ideas?

you need to ‘resize’ the viewport to achieve your goal…

I have a mac plugin that automaticlly does it for selected printer sizes or custom ratios…

or another that allows you to adjust the SU ‘window’ frame, while informing you of the viewport size…

john

Your description sounds backwards to how I think most people would proceed: instead, set up a SketchUp view showing the model from the desired direction and then use a system screenshot tool to select the desired rectangular area from the view.

That was my original idea, but I want to force the user to zoom in to fill the box, rather than select while it may be zoomed out. I thought this would result in a less pixelated image

You can draw a temporary non-model rectangle on the screen using the view.draw method (and its variants) within a Tool’s draw callback method. However, getting a high-quality image of just that portion of the view is a different question for which I don’t have a tested answer. Maybe you could calculate the ratio of the rectangle to the size of the viewport, zoom by that factor, and then do a view.write_image?

when SU exports an image it uses viewport pixel ratio as the basis for the size of the file…

if the viewport is rectangular and you specify a square, the resultant image will be ‘squashed’ to conform…

unlike a screenshot you can ‘scale’ the viewport export for higher resolution images, but unless you manually alter the shape you need a system call to ‘crop’ the full size image… [on mac you can use sips]

in my more simplistic plugin I write to the plist and use SU to close and reopen the file in the new window…

here’s a gif of how it works…

john

john, can you resize the viewport via ruby? I dont see any methods for that.

I do it all via Ruby, but not the with API…

it’s the same situation for PC’s and Enroth has a plugin the uses win32 calls for the actual resizing…

I can PM you that plugin if you want to inspect it…

john

that would be awesome!

Well, there is a piece of software that is one step beyond what you are asking for. Gadwin PrintScreen- www.gadwin.com

If you have a Windows machine, just use the “Snipping Tool”. Can’t get easier than that. If you have a Mac, I’m sure there is something similar in that OS as well.