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

    Image in Dialog

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 301 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 01/03/2005 at 05:36, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :     C++  ;

      ---------
      Well, I know there are quite a few topics about this but I couldn't get any of these to work. I'm trying to put a simple image into my dialoge.

      The dialoge is defined in a .res file, I can access all the things I've made there, change values ect, but I seem to be unable to put a simple bitmap in there.

      I've tried to add a UserArea and a BitmapButton, but without any results.

      has anyone a snipped of code he can show just to add a bitmap to a UserArea defined in the res file?

      Thanks and best Regards

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/03/2005 at 08:27, xxxxxxxx wrote:

        Don't use the .res file to add a bitmap. I never had luck with it. Don't need to use a UserArea either.

        Here's how I do it in GeDialog::CreateLayout() :

          
                       // Image  
                       GroupBegin(0, BFH_SCALEFIT|BFV_SCALEFIT, 0, 1, String(""), 0);  
                       {  
                            GroupBorderSpace(8,8,8,8);  
                            BitmapButtonCustomGui* bmbutton;  
                            BaseContainer bc;  
          
                            bc.SetLong(DESC_CUSTOMGUI,CUSTOMGUI_BITMAPBUTTON);  
                            bc.SetLong(BITMAPBUTTON_BORDER,BORDER_IN);  
                            bc.SetBool(BITMAPBUTTON_BUTTON,FALSE);  
                            // BitMap Button  
                            if (!(bmbutton = (BitmapButtonCustomGui* )AddCustomGui(4000,CUSTOMGUI_BITMAPBUTTON,String(),BFH_CENTER|BFV_CENTER,SizePix(256),SizePix(200),bc)))  
                                 throw ErrorException(ERROR_MEMORY, "AboutDialog.CreateLayout.bmbutton");  
                            Filename bg = GeGetPluginPath()+Filename("res")+Filename("about.jpg");  
                            if (GeFExist(bg)) bmbutton->SetImage(bg, FALSE);  
                       }  
                       GroupEnd();  
        

        If you know the image size, change the "SizePix()" values in the AddCustomGui() call. If not, you can preload the bitmap, get the dimensions, and go from there.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 02/03/2005 at 00:05, xxxxxxxx wrote:

          Ah, it works! Finally, at least something that works 😉

          Thanks Robert!

          Best Regards,

          Hans

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