So if I had a drawing like this: And a george script like this
Code: Select all
tv_imageGetBound layerID iPosition
bound = result // Returns 131 115 379 455 with this image
tv_rect bound
-Mads
Code: Select all
tv_imageGetBound layerID iPosition
bound = result // Returns 131 115 379 455 with this image
tv_rect bound
coolElodie wrote:Ok, let's todolist this.
Is there A George Command like this?ZigOtto wrote:+1
tv_SelectRect Bound
I was completing your feature request with mine which is in the same family,madsjuul wrote:Is there A George Command like this?ZigOtto wrote:+1
tv_SelectRect Bound
I dont think it is possible to manipulate the Selection with George. Or?
3xcool !Elodie wrote:... that's why I am about to todolist all the content of this conversation ^^
Until then here's a George version you can adapt...madsjuul wrote:I'm Looking forward to the tv_imageGetBound Feature!
Code: Select all
// tvImageBound.grg
// Svengali©2014 - All Rights Reserved
// Version .02 - May 14, 2014 - Draw and undraw bounding box around drawing
Param none
tv_GetActiveTool
OriginalTool = result // store tool
parse result ToolType d // get tool type
IF CMP(ToolType,"tv_restorebrush")
tv_BrushToClipboard // store CutBrush
END
tv_GetAPen
APen = result // store APen color
tv_GetWidth
Width = result // get project dimensions
tv_GetHeight
Height = result
tv_UndoOpenStack // suspend undo stack
tv_BrushCut 0 0 Width Height 0 // grab a copy of the current image
tv_BrushRestore OptimizeSource 1 // get pixels' bounding box
tv_GetActiveTool // get info on the CutBrush from the current image
parse result d d d d Width1 d Height1 d d d d d d d d d d d d d d d d d d d d origineX origineY d
tv_setAPen 200 0 0 // set APen to red
x1 = origineX - 1 // get upper left X corner of CutBrush within project
y1 = origineY - 1 // get upper left Y corner of CutBrush within project
x2 = origineX + Width1 // calculate lower right X corner of CutBrush within project
y2 = origineY + Height1 // calculate lower right Y corner of CutBrush within project
tv_Propelling RESET 1 // select single pixel tool
tv_Rect x1 y1 x2 y2 // draw red bounding box rectangle
tv_WaitButton 1 // wait for mouse LMB down click
IF CMP(ToolType,"tv_restorebrush")
tv_BrushFromClipboard // retrieve original CutBrush
END
tv_UndoCloseStack // reinstate undo stack
tv_Undo // remove red bounding box
tv_UpdateUndo // reinstate original image
tv_SetAPen APen // reset original APen color
tv_cmd OriginalTool // restore original Tool