sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    SDK: Get Images data

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 681 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.
    • M Offline
      Marc477
      last edited by

      In the Sketchup c++ SDK:

      What is the equivalent of SUTextureGetImageData for a SUImageRef? How can I access images pixel data?

      Thank you

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        Hmm... it looks like this might be missing. I'll double check and file an issue if it's truly missing.

        1 Reply Last reply Reply Quote 0
        • M Offline
          Marc477
          last edited by

          Any work around ?

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            Not that the API provides. You could extract to a temp file and read it.

            1 Reply Last reply Reply Quote 0
            • M Offline
              Marc477
              last edited by

              @tt_su said:

              Not that the API provides. You could extract to a temp file and read it.

              I'm not sure how I am supposed to extract the image to a file, if I cannot read its data.

              1 Reply Last reply Reply Quote 0
              • A Offline
                Aerilius
                last edited by

                There are no methods to read (or modify) individual pixels, but you can export a material's texture image using Sketchup::TextureWriter.
                Create a temporary group (so the material doesn't have any distortion), apply the texture and load it to the texture writer.

                1 Reply Last reply Reply Quote 0
                • tt_suT Offline
                  tt_su
                  last edited by

                  @marc477 said:

                  What is the equivalent of SUTextureGetImageData for a SUImageRef? How can I access images pixel data?

                  Update - SUImageGetData should be equivalent.
                  http://www.sketchup.com/intl/en/developer/su-api/image_8h.html#aedb99aee21a39619602866fc400766cb

                  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