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

How to scale Retina icons in BitmapButtons

 Post Reply Post Reply
Author
Message
Satara View Drop Down
Member
Member


Joined: 2009 Mar 30
Location: Germany
Online Status: Offline
Posts: 128
Post Options Post Options   Quote Satara Quote  Post ReplyReply Direct Link To This Post Topic: How to scale Retina icons in BitmapButtons
    Posted: 2013 Sep 04 at 3:37am

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!
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2546
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Sep 04 at 3:50am
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);




Edited by NiklasR - 2013 Sep 04 at 3:51am
Back to Top
Satara View Drop Down
Member
Member


Joined: 2009 Mar 30
Location: Germany
Online Status: Offline
Posts: 128
Post Options Post Options   Quote Satara Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Sep 04 at 4:08am
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 :)
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2546
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Sep 04 at 2:12pm
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



Edited by NiklasR - 2013 Oct 30 at 8:59am
Back to Top
Satara View Drop Down
Member
Member


Joined: 2009 Mar 30
Location: Germany
Online Status: Offline
Posts: 128
Post Options Post Options   Quote Satara Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Sep 05 at 4:44am
Ahh thanks for the tip. Completely forgot that :D
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...
Back to Top
xsyann View Drop Down
Member
Member


Joined: 2006 Apr 22
Location: France
Online Status: Offline
Posts: 27
Post Options Post Options   Quote xsyann Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 07 at 9:41am
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?
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1482
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 11 at 9:43am
Hi,

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

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


Joined: 2006 Apr 22
Location: France
Online Status: Offline
Posts: 27
Post Options Post Options   Quote xsyann Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 12 at 3:21am
Hi Andreas,

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

Thanks for the help.


Edited by xsyann - 2017 Sep 12 at 3:22am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1482
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 12 at 5:28am
No need to be sorry, that's what we are here for.

Cheers,
Andreas
SDK Support Engineer
Back to Top
 Post Reply Post Reply

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.