Inkscape.org
Beginners' Questions How to create a frame/outline for a rectangle?
  1. #1
    David Spector David Spector @david-dev

    How to create a frame/outline for a rectangle? I tried fill/stroke properties, no. I looked for frame/outline, couldn't find.

  2. #2
    Polygon Polygon @Polygon🌶

    I have no clue what you mean by frame/outline. Path effect "Offset" perhaps or Path->Outset/Offset?

  3. #3
    Hum Hum @Hum
    *

    David, do you mean a rectangle that has only a stroke and no fill? If so, you can change the fill size. See the Stroke and Fill Tab.

    Or, do you mean a smaller rectangle cut out of a larger rectangle ... so the end result appears as a frame... such as a frame for a picture?

    Can you explain better - and provide an image of your goal. And the tools and steps you have done?

    Thanks.

  4. #4
    David Spector David Spector @david-dev
    *

    I mean 'rectangle' as implemented on most graphic tools: a solid rectangle that can be filled in various ways, surrounded by a border having a color and a width. In CSS, a rectangle would be a DIV having a background-color property and a border property. I want my border/outline/frame to be, say, 2 pixels wide solid white. I can't see how to get this done in Inkscape except very clumsily by arranging a larger rectangle centered beneath a given rectangle.

  5. #5
    Hum Hum @Hum
    *

    You can create and resize a rectangle that has both a fill color and a stroke color, all on the same object. The colors can be the same or different colors by setting the stroke color to a different color. The stroke with can be precisely set. All accesible by using the Rectangle Tool and then accessing the Stroke and Fill Tab.

    Why not create your rectangle and then set the stroke by a set value and distinct color ... at different pixel widths (or mm, cm, etc.)

    A different way also is to make your needed rectangle, duplicate it, and create a clipping of one of these . The resulted outcome will be the size of the clip. The clipping is editable and can be re-positioned where it suits your needs.

    You can also create two different rectangles and do a Path > Difference or Intersection operation between them that serves as a disinct frame.

  6. #6
    David Spector David Spector @david-dev

    I didn't find any way to make a frame/border using the stoke dialog box. But I will look again when I next have time.

  7. #7
    Hum Hum @Hum
    *

    As an experiment, make a solid red filled rectangle and set the stroke to a different color, such as black. Set that stroke  with to a strong value as in 20 px or more. All on the Stroke and Fill Tab after you have first  selected the rectangle Path. It will not read as "frame".

    The visual result will be a red filled rectangle with a black stroke that resembles a "frame".

  8. #8
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Inkscape's fill and stroke could well be different from the applications you're familiar with. The built-in tutorials are usually a good starting point. [Help > Tutorials > Inkscape: Basic] and [Help > Tutorials > Inkscape: Shapes].

  9. #9
    Hum Hum @Hum

    Here is a screen capture.

    Filland Stroke
  10. #10
    David Spector David Spector @david-dev

    I am using Windows 11, which has a few bugs, so when I take a screenshot, nothing happens (I don't get the screenshot editor notification). So I cannot take a screenshot. But, I will try to describe it. In Hum's screenshot nearby, I just see the right-hand side, the main fill and stroke dialog box. There is no picture of the rectangle, and no way to choose a color or a thickness for the outline or border or whatever it is officially called. The rectangles that I create using the Rectangle tool have no border or outline or periphery or whatever it is officially called in Inkscape. The tutorial for Rectangle doesn't help me.

  11. #11
    Hum Hum @Hum

    So, you use the Rectangle Tool and nothing is visible, despite any fill color or stroke color used? When you use the Ellipse Tool, is the same non-visible results occur ?

    Can you use the bezeir tool and pen tool with visible results? How about the polygon tool?

    What version of Inkscape do you have?

    If you close the file and Inkscape and re-start the program, does this happen again?

  12. #12
    Polygon Polygon @Polygon🌶

    I'd try to go to Inkscape's Preferences->System and hit "Reset Preferences " and restart Inkscape.

  13. #13
    David Spector David Spector @david-dev

    I apologize for being busy; I finally found that using the menu item next to Stroke let me increase the border width so I could see it, as several of you suggested. I would suggest to the tutorial writers that they explain that "stroke" is the border part of the rectangle. It seems obvious now. So that solved this problem. When I rendered the output to PNG format, my white and gray colors turned into white and blue (it never did that with my older version of Inkscape). Should I post a separate question about that? I'm not sure what the etiquette is here.

  14. #14
    Tyler Durden Tyler Durden @TylerDurden

    Feel free to share the example file... if it gets complicated, we'll split it off to its own topic.

  15. #15
    David Spector David Spector @david-dev

    Here are my sgf and png files. When I display them on my computer SYS7, they look perfect. But on computer SYS8, where I created them, the cur.png file looks light blue. How can a PNG file look different on different computers?

    Cur
    Gradient
  16. #16
    Tyler Durden Tyler Durden @TylerDurden

    I'd be looking into monitor and display settings on the light blue SYS8.

     

  17. #17
    David Spector David Spector @david-dev

    Thanks to everyone for their help.

    You were correct. I found the problem in an obscure preference in IrfanView, which was why the problem only happened on one of my computers.

    My original problem above was due to my failing to understand what "stroke" means in Inkscape jargon. Unlike other drawing programs I've seen, where a "stroke" means a "line" or "curve", in Inkscape it means "outline" or "border" or even, yes, "frame".

  18. #18
    Tyler Durden Tyler Durden @TylerDurden

    JFYI, this is more than Inkscape jargon... stroke and other SVG technical terms are designated by the W3C, the international commission for web standards

     

  19. #19
    David Spector David Spector @david-dev

    Very interesting how vector graphics and the SVG standard have changed our terminology. Pretty soon Inkscape will have to be upgraded to meet multiple nested borders and probably lots more stuff that the theorists think up. It's progress. But the term "outline" is ambiguous, so perhaps a bad choice. Is a document outline a border or a hierarchical summary? Not my problem.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions How to create a frame/outline for a rectangle?