Image in Dialog



  • 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



  • 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.



  • 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


Log in to reply