sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Toolbar Icon Size on 4K Monitor

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    41 Posts 10 Posters 6.8k Views 10 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PixeroP Offline
      Pixero
      last edited by

      Could someone post a code snippet that shows how to implement svg or pdf icons so I could start updating my own plugins at least.

      1 Reply Last reply Reply Quote 0
      • S Offline
        slbaumgartner
        last edited by

        Here's an example from one of my extensions:

        
        if(not file_loaded?(__FILE__))
          cmd = UI;;Command.new("RakeAndSplay") {Sketchup.active_model.select_tool(SLBPlugins;;RakeAndSplayTool.get_tool)}
          cmd.menu_text = "Rake and Splay"
          if(Sketchup.version.to_i >= 16)
            if(RUBY_PLATFORM =~ /darwin/)
              cmd.small_icon = Sketchup.find_support_file("rake_and_splay.pdf", "Plugins/SB_rake_and_splay")
              cmd.large_icon = Sketchup.find_support_file("rake_and_splay.pdf", "Plugins/SB_rake_and_splay")
            else
              cmd.small_icon = Sketchup.find_support_file("rake_and_splay.svg", "Plugins/SB_rake_and_splay")
              cmd.large_icon = Sketchup.find_support_file("rake_and_splay.svg", "Plugins/SB_rake_and_splay")
            end
          else
            cmd.small_icon = Sketchup.find_support_file("rake_and_splay_16.png", "Plugins/SB_rake_and_splay")
            cmd.large_icon = Sketchup.find_support_file("rake_and_splay_24.png", "Plugins/SB_rake_and_splay")
          end
          tb = UI;;Toolbar.new("Rake and Splay").add_item(cmd)
          tb.restore if tb.get_last_state == 1
          UI.menu("Tools").add_item cmd
        end
        file_loaded(__FILE__)
        
        
        1 Reply Last reply Reply Quote 0
        • PixeroP Offline
          Pixero
          last edited by

          Thanks.

          1 Reply Last reply Reply Quote 0
          • Bob JamesB Offline
            Bob James
            last edited by

            Thank you, slbaumgartner
            Would you tell me how to use this for each plugin extension?

            i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

            1 Reply Last reply Reply Quote 0
            • Bob JamesB Offline
              Bob James
              last edited by

              @slbaumgartner said:

              simply dropping a svg file into the folder won't do the trick

              He's right!
              I converted and replaced the icons in SketchUcation to .svg at 300pixelsx300pixels at 300dpi but there was no change in SU2018

              icons 300-1.png

              i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

              1 Reply Last reply Reply Quote 0
              • S Offline
                slbaumgartner
                last edited by

                @bob james said:

                Thank you, slbaumgartner
                Would you tell me how to use this for each plugin extension?

                If you're not familiar with Ruby API programming for SketchUp, you might be in over your head as the code needs to be adapted to each specific extension, there is no universal drop-in-place form.

                You need to create the appropriate icon files (svg, pdf, and png) for the extension and put them in the extension's folder. Then you need to find where in the extension's code it creates and populates its toolbar and integrate my snippet with whatever the original code does there, which will almost surely vary from case to case.

                1 Reply Last reply Reply Quote 0
                • fredo6F Offline
                  fredo6
                  last edited by

                  For inof, all my plugins can support PNG, SVG and PDF (as everything is managed by LibFredo6).

                  I am just missing the icons in SVG / PDF

                  That's just a matter to put the SVG / PDF file in:

                  • subfolder IMAGES_Standards of the plugin folder (say Fredo6_FredoScale/IMAGES_standard)
                  • respecting convention: same name as PNG but removing the trailing _24 (or _16 or _32). So FSC_icon_Scale_24.png would become FSC_icon_Scale.svg

                  Fredo

                  1 Reply Last reply Reply Quote 0
                  • PixeroP Offline
                    Pixero
                    last edited by

                    Question. Does the svg/PDF icons need to be made in a special size? (I know they are scaleable just wondering if the dokument size should be anything special.)

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      slbaumgartner
                      last edited by

                      @pixero said:

                      Question. Does the svg/PDF icons need to be made in a special size? (I know they are scaleable just wondering if the dokument size should be anything special.)

                      You can draw the icon artwork at whatever size you wish. The view of the contents will be scaled to fit the available space in the toolbar button, so the physical size you drew is irrelevant. But you do need to verify that you haven't put details into the artwork that won't be visible when scaled to a typical toolbar button on a particular size display. Since you probably don't have a lot of different displays available to test, the best practice is to keep your icons fairly simple.

                      One precaution though: Whatever size you draw, you should keep the drawing canvas square. Otherwise SketchUp will scale it based on the larger dimension and it won't fill the full button in the other direction.

                      1 Reply Last reply Reply Quote 0
                      • Bob JamesB Offline
                        Bob James
                        last edited by

                        @unknownuser said:

                        For inof, all my plugins can support PNG, SVG and PDF (as everything is managed by LibFredo6).

                        Awesome!!

                        @slbaumgartner said:

                        You can draw the icon artwork at whatever size you wish. The view of the contents will be scaled to fit the available space in the toolbar button, so the physical size you drew is irrelevant. But you do need to verify that you haven't put details into the artwork that won't be visible

                        Do I have to re-draw them? Can't I just continue converting them from jpg/png to svg?

                        i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          slbaumgartner
                          last edited by

                          You can convert png or jpg to svg or pdf, but since the content is a raster image it most likely won't look good when scaled. The contents need to be vector to scale cleanly.

                          1 Reply Last reply Reply Quote 0
                          • Paul RussamP Offline
                            Paul Russam
                            last edited by

                            PNG and JPG are raster images whilst SVG is a vector, Whilst you can save a raster image as an SVG its a complete waste of time as it will remain a raster image but it'll be encoded in XML and be substantially larger (file size) than the original.
                            To create proper SVG's you need a vector app such as Adobe Illustrator, Affinity Designer etc. Photoshop (raster app) will NOT create proper SVG's
                            SVG's are size independent, they will look no better or worse if you create them on a 10000x10000px canvas or a 100x100 one and dpi is irrelevant outside of the paper print industry for any image be it JPG, PNG or especially SVG.

                            I've attached a zip file containing 2 SVG's, one is a logo I did recently (lei-logo-pt1-colour.svg) in Affinity Designer. If you look at it in a text editor you'll see its just a simple set of instructions in XML defining an elements shape/fill/border etc.
                            The other is an SVG I hand wrote for fun (SolarSys-V4.svg), as it's handwritten it's far clearer to see the XML structure ... and it's animated ๐Ÿ˜„

                            TL;DR
                            Don't convert PNG/JPG to SVG, make them from scratch.


                            sample svgs.zip

                            Paul Russam
                            English doesn't borrow from other languages. It follows them down dark allies, knocks them over, and goes through their pockets for loose grammar.

                            1 Reply Last reply Reply Quote 0
                            • dereiD Offline
                              derei
                              last edited by

                              Inkscape has a feature to vectorize a bitmap (Trace Bitmap) and it can be used to quickly convert some icons, provided you have a decent quality of the raster image.
                              You can try with small icons, but I doubt there will be enough resolution in them to get a decent result. See attached.
                              However, with a decent quality image, the results can be impressive.

                              ice_screenshot_20180509-104422.png

                              DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                              1 Reply Last reply Reply Quote 0
                              • Bob JamesB Offline
                                Bob James
                                last edited by

                                Miracle ๐Ÿ˜ฎ

                                With the latest Win10 update all icons are now full size!!! Not to look a gift horse in the mouth but now I wish I could make them a bit smaller ๐Ÿ˜Ž

                                Has this happened to anyone else?

                                new-2.png

                                i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                                1 Reply Last reply Reply Quote 0
                                • Bob JamesB Offline
                                  Bob James
                                  last edited by

                                  UPDATE

                                  Updated Nvidia driver from 391.35 to 397.31 and all of the non-svg icons went back to tiny. ๐Ÿ˜ž

                                  i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                                  1 Reply Last reply Reply Quote 0
                                  • jujuJ Offline
                                    juju
                                    last edited by

                                    @bob james said:

                                    UPDATE

                                    Updated Nvidia driver from 391.35 to 397.31 and all of the non-svg icons went back to tiny. ๐Ÿ˜ž

                                    Are you sure the screen resolution was set correctly by the previous driver when you did that update?

                                    Save the Earth, it's the only planet with chocolate.

                                    1 Reply Last reply Reply Quote 0
                                    • Bob JamesB Offline
                                      Bob James
                                      last edited by

                                      @juju said:

                                      Are you sure the screen resolution was set correctly by the previous driver when you did that update?

                                      No way to know now unless I go back to 391.35. Resolution is set at its recommended value.

                                      i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                                      1 Reply Last reply Reply Quote 0
                                      • Bob JamesB Offline
                                        Bob James
                                        last edited by

                                        UPDATE

                                        I re-loaded the latest Nvidia driver and that fixed the problem: all the icons are full size. But, as I said before, they are actually too large and would really like some way to scale them down, Change the screen scale??

                                        i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                                        1 Reply Last reply Reply Quote 0
                                        • PixeroP Offline
                                          Pixero
                                          last edited by

                                          I've just updated my 3pt Window and 3pt Rectangle scripts with vector icons.

                                          1 Reply Last reply Reply Quote 0
                                          • Bob JamesB Offline
                                            Bob James
                                            last edited by

                                            Thank you Pixero

                                            i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement