Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Register
    • Login

    Tool icon variants

    SDK Help
    0
    3
    936
    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 03/08/2018 at 14:23, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R19 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi,

      The recommended icon size for DescriptionToolData is 32x32, but it looks very low res in the toolbar.
      If I double the size, it will look great on the toolbar, but gigantic besides the mouse pointer.
      Is there a way to register a high-res icon for the toolbar and a low-res icon for the pointer?

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

        On 07/08/2018 at 01:02, xxxxxxxx wrote:

        Hi,

        well, yes, in theory you can register two different icons, I'll get back to this at the end, but it's actually way simpler.

        The key is to set the BASEBITMAP_DATA_GUIPIXELRATIO correct (for a 64 by 64 icon it's 2.0) for the bitmap, then everything will work automatically with just one icon. Therefore you have several options:

        // when using [AutoBitmap](https://developers.maxon.net/docs/cpp/2023_2/class_auto_bitmap.html), set it directly
        BaseBitmap* bmp = AutoBitmap("myicon_64x64.tif", 2.0);
        // Or when allocating a bitmap manually
        BaseBitmap* bmp = BaseBitmap::Alloc();
        if (bmp->Init(GeGetPluginResourcePath() + "myicon_64x64.tif") != IMAGERESULT_OK)
        	return false;
        bmp->SetData(BASEBITMAP_DATA_GUIPIXELRATIO, 2.0);
        

        But if you want to, you can also register as many icons of various sizes as you like, via RegisterIcon() (with ICONFLAG_2X).
        Then you'd need to set the RESULT_CURSOR in the BaseContainer in GetCursorInfo() to the registered icon ID. Remember to use unique IDs to register icons.

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

          On 10/08/2018 at 08:00, xxxxxxxx wrote:

          Perfect, thanks!

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