PNGs for CUI

Does BCAD support PNGs in a resource only DLL for CUI icons? (as per ACAD 2017)

Comments

  • Per Gogstad
    edited May 2017

    See page 118 of the eBook, Customizing BricsCAD V17. It might give you the information you are looking for.

    https://www.bricsys.com/en-intl/documentation/

  • That page indicates that PNGs are supported directly, but how about from a resource DLL? The book says that images from a resource DLL don't even work (they do). I can see my PNG IDs in the DLL, but BricsCAD doesn't seem able to properly extract/display them.

    Is that because I haven't create my DLL properly or because it just doesn't work in BricsCAD?

  • Interesting subject. Dan, the reason you ask is that you don't want a bunch of PNG's in the directory where your CUI lives, like %appdata%\YourOrg\AppName\20.1\YourMenu.cui (20.1 is rel. nr. V17)?

    Anyway, https://www.bricsys.com/common/knowledge/topic.jsp?id=169 probably helps.

    Zip icons and rename to .YourMenu.resz is a gentle way to go. Keep resz file name same as cui file name. I used 7zip, just zip archive, normal compression, nothing fancy.

  • Dear Dan,

    there is a little trick with "icon resources inside DLL" - Microsoft offers multiple ways to identify a resource icon/bitmap :

    • by integer ID
    • by string ID

    as far as I recall, using string ID like "ID_MYICON_1" works ... and the menus/cuis then refer to ID_MYICON_1;
    having ID_MYICON_1 as integer (enum) does not work ...

    maybe this helps a bit ?
    man ygreetings !

  • Just out of curiosity, if RESZ containers are very easy to make and are platform independent, is there a reason to use DLL's?

  • Dear Wiebe,

    indeed, .resz makes much more sense :-)
    but sometimes, developers are afraid about their stuff ... sometimes the workflow would need to change, and so on ...
    all those reasons aside from the core icon/bitmap storage topic-
    many greetings !

  • Dan Crosby
    edited May 2017

    My main reason for wanting this is laziness :) I'm supporting BricsCAD and AutoCAD - so I already had a BMP-based, resource-only DLL for my icons that worked with both hosts. Now, with ACAD 2017, I'm forced to use ICO or PNG files if I want transparency. I don't really understand why they removed the working BMP 'transparency' system - but when do we ever understand why Autodesk do anything?

    I was hoping to replace my BMPs with PNGs, leaving their resource IDs the same, so I don't have to change my CUI / CUIX files. I find in AutoCAD I can add my PNGs as RCDATA resources and they can be picked up from the DLL. No so with BCAD - whether I use THIS_ID or "THIS_ID" - RCDATA ids show up in the CUI editor, but not the icons themselves (you just get the generic question mark image).

    It's looking like I might need to keep both BMPs and PNGs in the DLL, or use separate approaches for ACAD and BCAD.

  • Dear Dan,
    have you sent us a support request about this problem ? I think, we should be able to use PNG from resource DLL ...
    many greetings !

  • ... supporting BricsCAD and AutoCAD ...

    Same here and managing multiple projects at that. What we do (for least time wasted) is use CUIx files as our primary file to maintain, using all transparent PNG files. The ACAD CUI tool is "less than optimal" but if it bothers you the CUIx file is actually just a renamed ZIP file. Anyway thanks to BricsCAD you only need to use their menuload tool, select the CUIx and it will make a nearly perfect CUI/ResX combo including menus, ribbons, etc. There is one quirk where large vertically stacked (using \n) ribbon icons don't translate (there is a support request in on that but it's not gone anywhere).

    Overall we have found that to be the fastest way to maintain the two systems. Hopefully BricsCAD will adopt the CUIx and we will only need one !!!

  • @Torsten Moses said:
    Dear Dan,
    have you sent us a support request about this problem ? I think, we should be able to use PNG from resource DLL ...
    many greetings !

    Hi Torsten,

    I haven't but I will... I just wasn't sure if it didn't work or I was doing it wrong!

    Dan

This discussion has been closed.