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

    Showing icon in dialog box

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 440 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

      On 12/01/2015 at 03:36, xxxxxxxx wrote:

      Hello,

      I like to show an icon in the Python Dialog. So far I thought it would be simple, but somehow I'm stuck right at the beginning.

      First off I get the icon properties:

      icon = gui.GetIcon(c4d.RESOURCEIMAGE_MOVE)  
      bmp = icon["bmp"]  
      x, y = icon["x"], icon["y"]
      

      then I thought I could simply draw it, but I need a GeUserArea for that, right? Does that still function if I create the layout with AddStaticText?

      For instance, I've got a simple dialog box with the selected object including the icon written in that dialog box: "Selected Object: [Icon] Cube"

      How does one do that?

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

        On 12/01/2015 at 09:13, xxxxxxxx wrote:

        Hello,

        there is no simple GUI element that just displays images. One way to display a bitmap is to use a GeUserArea [URL-REMOVED]and then draw the Bitmap using DrawBitmap()[URL-REMOVED]. A example on how to use the GeUserArea can be found in the Py-MemoryViewer.pyp[URL-REMOVED] example.

        Another way to display images is to use a BitmapButtonCustomGui[URL-REMOVED]. Using this option allows you to directly use the icon data delivered by GetIcon()[URL-REMOVED].

        What do you mean with "create the layout with AddStaticText"? You create layouts using groups with GroupBegin()[URL-REMOVED] and GroupEnd()[URL-REMOVED]. There you can define the number of columns.

        For what you want you could also use a default LinkBoxGui[URL-REMOVED] element. Such a link box displays the linked object with it's icon.

        Best wishes,
        Sebastian


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

          On 23/01/2015 at 08:20, xxxxxxxx wrote:

          Hello TechnoFeather,

          was your question answered?

          best wishes,
          Sebastian

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