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 force resize the Native and 3rd Party Plug-in Icons?

    Cinema 4D SDK
    r21 python
    2
    3
    409
    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.
    • B
      bentraje
      last edited by bentraje

      Hi,

      I'm trying to use resize the native and 3rd party plug-in icons but they don't respect the width and height I specified.

      Here is a code snippet:

              bcBitmapButton = c4d.BaseContainer()
              bcBitmapButton[c4d.BITMAPBUTTON_BUTTON] = True
      
              w = 12
              h = 12
      
      
              null_btn_id = 1001
              null_btn = self.AddCustomGui(null_btn_id, c4d.CUSTOMGUI_BITMAPBUTTON, "", c4d.BFH_CENTER|c4d.BFV_CENTER, w, h, bcBitmapButton)
              null_icon = c4d.bitmaps.InitResourceBitmap(c4d.Onull)
              null_btn.SetImage(null_icon, True)
      

      As you can see I specified 12x12 size but the native icon maintain its 50x50 and th 3rd party icons maintain its 100x100 size.

      You can see an illustration of the problem here:
      https://www.dropbox.com/s/wfwsyas21agidq2/c4d160_python_force_resize_icon.jpg?dl=0

      Thank you for looking at my problem

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @bentraje you can use BITMAPBUTTON_FORCE_SIZE
        The python documentation is wrong is not a boolean but an int (It will be fixed in the next documentation update).

        So you can define it as:
        bcBitmapButton[c4d.BITMAPBUTTON_FORCE_SIZE] = 12

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 2
        • B
          bentraje
          last edited by

          @m_adam

          Thanks for the response. Works as expected.

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