sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    SKP write thumbnail. SIZE?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 372 Views 3 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.
    • jolranJ Offline
      jolran
      last edited by

      I guess there is no simple way to set the size on Sketchup.save_thumbnail?

      I'm using something similar Dan's snippet.
      http://sketchucation.com/forums/viewtopic.php?t=24876

      It's strange the png's come out 64 X 128 pixels. Most of the times I would rather like to have 64 X 64. I mean Square proportions. Component window has thumbs in thoose proportions for ex..

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @jolran said:

        I guess there is no simple way to set the size on Sketchup.save_thumbnail?

        No the size is dependent upon the aspect ratio of the viewport, in SketchUp when the file is saved. (Which may be outside the control of your plugin.)

        @jolran said:

        I'm using something similar Dan's snippet.
        http://sketchucation.com/forums/viewtopic.php?t=24876

        This is for EXTRACTING whatever pre-made thumbnail is already embedded within the SKP file.
        The SKP file(s) do not need to actually be open within SketchUp.

        @jolran said:

        It's strange the png's come out 64 X 128 pixels. Most of the times I would rather like to have 64 X 64. I mean Square proportions. Component window has thumbs in thoose proportions for ex..

        If you wish to control the size of a thumbnail, you will have to open the file within SketchUp, and use View.write_image()

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • jolranJ Offline
          jolran
          last edited by

          Ah, I see.

          Im sending thumbs to Webdialog from premade components located in a pluginfolder.
          Quite many of them.

          This seams like to much hassle, I can fix it in the CSS side, no worries..

          Will take a look if I can do something different when saving them though.

          Thanks.

          1 Reply Last reply Reply Quote 0
          • jeff hammondJ Offline
            jeff hammond
            last edited by

            i was farting around with this stuff and needed something similar.. TIG & tt helped me out with this

            model = Sketchup.active_model view = model.active_view keys = { :filename => "/Users/jeff/Desktop/write_image.png", :width => 640, :height => 480, :antialias => false, :compression => 0.9, :transparent => true } view.write_image(keys)

            (obv change the path and others accordingly)
            it's fast though and gives you some decent controls..

            dotdotdot

            1 Reply Last reply Reply Quote 0
            • jolranJ Offline
              jolran
              last edited by

              Nice! Something like this I had in mind.
              Thanks Jeff.

              Let's see if I can make it work with Sketchup.save_thumbnail.

              edit: Hmm, not trivial.

              1 Reply Last reply Reply Quote 0
              • jeff hammondJ Offline
                jeff hammond
                last edited by

                oh.. i was thinking you use this as the thumbnail.. and avoid the save_thumbnail part..
                maybe that's not an option in your situation though?

                dotdotdot

                1 Reply Last reply Reply Quote 0
                • jolranJ Offline
                  jolran
                  last edited by

                  Maybe not for this part. I already have a folder with components.
                  But your code might be very useful for a different projekt I have. πŸ˜‰

                  This code would have to run each time to see if the user has added new components, when launching the webdialog. And add thumbs to the list.

                  I already had it working before with 128 px X 64 px, but it would be nice to be able to set the thumbs proportions.

                  As of now I'm clipping the image in CSS with 2 divs. Never mind how I'm doing it BTW.. The main point is that I may not be able to support IE7 with several imagehacks.

                  BTW a side question: Trying to stay "Sketchup like" with the dialog. Could there be any copyright issues, mimicing Sketchup GUI interface?

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

                  Advertisement