How to force resize the Native and 3rd Party Plug-in Icons?



  • 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



  • 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.



  • @m_adam

    Thanks for the response. Works as expected.


Log in to reply