Macro Snip/it

Descrizione
Usare questa macro per pubblicare facilmente screenshot nel forum di FreeCAD.

Si può aggiungere questa macro alla barra degli strumenti delle macro personalizzate globali per un accesso rapido e semplice.

Quando si pubblica sul forum di FreeCAD spesso è utile poter includere delle schermate. Questa macro serve a semplificare un po' questo lavoro.

Usage
La macro può acquisire schermate o utilizzare schermate esistenti che sono già state copiate negli Appunti del sistema. Per bypassare l'immagine già presente negli Appunti premere il tasto Maiusc mentre si richiama la macro. Per utilizzare la macro per acquisire lo screenshot, regolare le dimensioni e il posizionamento della finestra di dialogo che viene visualizzata, quindi fare clic su OK. Facendo clic su OK, la macro tenta di acquisire uno screenshot dell'area dello schermo coperta dalla finestra di dialogo. La finestra di dialogo è semitrasparente, quindi si possono vedere i contenuti sottostanti.



After clicking, the macro then takes the screenshot and saves it to a temporary file. A file open dialog is then opened at the file's location. You can drag and drop the file from there to the forum into the textarea where you type in your text for your forum post. Upon canceling the dialog the temporary screenshot file is deleted automatically. You may also open the screenshot file in your default application installed for opening files (on Windows this is typically Paint). This can be useful if you wish to add some annotations to the screenshot or perhaps additional editing, such as cropping.



If the macro doesn't work on your system to capture screenshots it can still be useful for screenshots you have captured using other tools. Simply copy the screenshot to the clipboard, then run the macro. It will create the temporary file and open the file's directory in an open file dialog for you. Some other tools for taking screenshots:


 * Windows: Windows Key + +
 * MacOS: +  +
 * Linux: gnome-screenshot utility

Parameters
The Macro supports user parameters, which can be set using


 * ,, , : location and size of snip box last use
 * (0.85): a value between 0.0 (less opaque) and 1.0 (more opaque)
 * (0.5): time (in seconds) delay between snip box close and snip
 * (0): desired width (in pixels), ignored if 0 -- scales image to desired with keeping current aspect ratio
 * (1.0): desired scale factor, (overrides DesiredWidth if ScaleFactor is not 1.0) -- scales image to scale factor

The parameters are reset by the macro each time it is run. This is how it keeps track of where to place the snip box, which is the last place it was when the user took a screenshot.

The parameter is the opacity of the snip box.

The parameter can be adjusted to speed things up a bit, but if the value is too small the screenshot taken might include the snip box itself because there needs to be duration of time to close the dialog before taking the screenshot.

The parameter scales the image to the desired width unless it is 0 (the default) in which case no scaling is done. For example, if you set the desired width to 800 then you will get images that are 800 pixels wide. The height will be automatically scaled to maintain the current aspect ratio. If the original image was 1600x1200 and the DesiredWidth is 800, then the resulting image will be 800x600.

The parameter scales the image to the desired ratio, e.g. 0.5. The default is 1.0, in which case no scaling is done. This overrides the DesiredWidth parameter if ScaleFactor is not 1.0.

You can bypass all scaling by holding down the Ctrl key while clicking the Ok button to take the screen shot.

Script
ToolBar icon

Macro_Snip.FCMacro

Link
The forum discussion Snip macro