davide445 Posted June 1, 2015 Share Posted June 1, 2015 I know is stupid but. Need to create a mask such as the attached one. The image size is . 1920x1080, the inside transparent rectangle need to be 1728x540, positioned 96, 108 pix from the upper left corner. What I'm missing is how to define exactly the size of the drawed rectangle and his relative position. Quote Link to comment Share on other sites More sharing options...
midora Posted June 1, 2015 Share Posted June 1, 2015 Use the 'Rectangle Select' Tool. In the status bar you can see the cursor position. Place the cursor at the start position and drag out the rectangle. The status bar tells you the size of the bounding rectangle while dragging. After releasing the mouse button at the right rectangle size press the Delete key to set the selection to transparent. Use a zoom value >= 200% if it is difficult for you to place the cursor at the right poistion. Quote Link to comment Share on other sites More sharing options...
davide445 Posted June 1, 2015 Author Share Posted June 1, 2015 Thanks I did finally use Inkscape to obtain the same result. A pity since Paint.net appear to be easier to obtain transparency and gradient effects, but I'm not able to fine control the position of this central rectangle. Without a dialog box where I can set the relative position I did need to look at the numbers in the status bar and calculate the right offset from the rectangle center (I can't fine a way to calc it from one of the rectangle corners), simply didn't work. Quote Link to comment Share on other sites More sharing options...
jimofoz Posted June 1, 2015 Share Posted June 1, 2015 Select the Mask tool, then select Fixed Sized and make it the size you want. Select the white moving arrowhead and move it close to where you want it, then use the cursors to nudge it one pixel at a time until it's in the desired location. Set View to show pixels. Quote Link to comment Share on other sites More sharing options...
MJW Posted June 1, 2015 Share Posted June 1, 2015 (edited) Here is a CodeLab plugin called Rectangle Eraser that will erase a rectangle at a specified position and size: RectangleEraser.zip It's in the Adjustment menu. Here is the icon: Here is the source: Hidden Content: // Author: MJW // Name: Rectangle Eraser // Title: Rectangle Eraser // Desc: Erase a rectangle of a specified position and size // Keywords: erase rectangle #region UICode int Amount1 = 0; // [0,5000] X Position int Amount2 = 0; // [0,5000] Y Position int Amount3 = 100; // [1,5000] Width int Amount4 = 100; // [1,5000] Height #endregion // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { int startX = Amount1, startY = Amount2; int endX = startX + Amount3, endY = startY + Amount4; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { dst[x, y] = ((x >= startX) && (y >= startY) && (x < endX) && (y < endY)) ? ColorBgra.Transparent : src[x, y]; } } } Edited June 1, 2015 by MJW 3 Quote Link to comment Share on other sites More sharing options...
Eli Posted June 1, 2015 Share Posted June 1, 2015 (edited) MJW, very interesting plugin. It has lots of potencial. It works as a traditional hole puncher. Maybe a few other shapes could be added. Edited June 1, 2015 by Eli Quote Link to comment Share on other sites More sharing options...
MJW Posted June 1, 2015 Share Posted June 1, 2015 I'll think about doing that, Eli. Though I intended it to be a quick fix for davide445's problem, I can see how a more general version might be useful. Quote Link to comment Share on other sites More sharing options...
Eli Posted June 1, 2015 Share Posted June 1, 2015 I think users will have uses for it specially if it can import already made mask. Just an idea. Quote Link to comment Share on other sites More sharing options...
MJW Posted June 1, 2015 Share Posted June 1, 2015 I probably should mention that I post the source code (even as trivial as the code for this plugin) so that anyone who wants to, can use it for other plugins. If I post a plugin, and someone wants to make a better or fancier version, they can do so without asking, and with my blessing., Quote Link to comment Share on other sites More sharing options...
davide445 Posted June 2, 2015 Author Share Posted June 2, 2015 Thanks all, in fact I returned to Paint.net for other activities on this mask. Really a nice program, need only some time to familiarize with it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.