Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Tool icon variants

Author
Message
  Topic Search Topic Search
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Topic: Tool icon variants
    Posted: 2018 Aug 03 at 2:23pm

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?
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Aug 07 at 1:02am
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, 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.

Cheers,
Andreas
SDK Support Engineer
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Posted: 2018 Aug 10 at 8:00am
Perfect, thanks!
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.