Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    How to scale Retina icons in BitmapButtons

    SDK Help
    0
    9
    672
    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.
    • H
      Helper
      last edited by

      On 04/09/2013 at 03:37, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R15 
      Platform:   Windows  ; Mac  ;  
      Language(s) :

      ---------
      Hi,

      for the R15 version of our plugin we have created icons with higher resolution to support retina displays (exactly the same sizes as in the new CINEMA 4D R15 icons). Now we have the problem that bitmapbuttons appear too big since they use the sizes of the new icons.

      Currently we're using a R14 build of the plugin, where the icons get registeres like this:
      RegisterIcon(ICON_ID, g_icons, 0, 0, 32, 32, (1<<2));

      (1<<2) is the value of ICONFLAG_2X, which doesn't seem to have any effect.
      These ids are then used as the values for BITMAPBUTTON_ICONID1/2.

      Is this solvable without recompiling for r15? How do we get the correct scale of the buttons?

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 04/09/2013 at 03:50, xxxxxxxx wrote:

        Have you tried to specify the size of the bitmap button like this?

        bc.SetBool(BITMAPBUTTON_BUTTON,
                    bc.SetLong(BITMAPBUTTON_ICONID1, RESOURCEIMAGE_AMDUPLICATE);
                    bc.SetBool(BITMAPBUTTON_TOGGLE, FALSE);
                    AddCustomGui(BTN_DUPLICATE, CUSTOMGUI_BITMAPBUTTON, "", 0, 16, 16 , bc);

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 04/09/2013 at 04:08, xxxxxxxx wrote:

          Yes just tried it, but it doesn't work. I think with this one can only make the icons bigger since it defines the minimum dimensions. The opposite would help though 🙂

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 04/09/2013 at 14:12, xxxxxxxx wrote:

            Why don't you just use Cinemas already registered icons?

            - Magnifier Glass: RESOURCEIMAGE_BROWSER_SEARCH
            - Big View: RESOURCEIMAGE_BROWSER_BIGVIEW
            - Small View: RESOURCEIMAGE_BROWSER_SMALLVIEW

            Source: <[URL-REMOVED]>


            [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 05/09/2013 at 04:44, xxxxxxxx wrote:

              Ahh thanks for the tip. Completely forgot that 😄
              This happened because previously we used a slightly modified version of bigview/smallview icons and the search option was added later.

              Nevertheless it would be cool to know how to support retina displays with custom icons...

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 07/09/2017 at 09:41, xxxxxxxx wrote:

                Hi,

                Is there a solution using custom registered icons?
                It seems that ICONFLAG_2X still has no effect with R18, or rather the same effect than ICONFLAG_0 (no copy and no size effect).

                I am looking for a solution to display bitmaps for retina in a plugin dialog.

                Does someone know how to do that?

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 11/09/2017 at 09:43, xxxxxxxx wrote:

                  Hi,

                  please check out the BaseBitmap manual (Properties), which shows how to do it for a BaseBitmap.

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 12/09/2017 at 03:21, xxxxxxxx wrote:

                    Hi Andreas,

                    Sorry I hadn't found this example in the documentation, thanks for the information.
                    It works fine!

                    Thanks for the help.

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 12/09/2017 at 05:28, xxxxxxxx wrote:

                      No need to be sorry, that's what we are here for.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post