Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8500243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:53:33+00:00 2026-06-11T00:53:33+00:00

I need to create an image with transparency placed on top of another image,

  • 0

I need to create an image with transparency placed on top of another image, inside a regular Gtk# window. The first image should be able to respond to mouse clicks.

The simple way would usually be to put an Image inside an EventBox – and inside the window. However, EventBox is not transparent by default, so even if the png Image itself has transparent areas, when inside the EventBox it shows as a square opaque background around the image.

I’m aware that EventBox can be made transparent using Cairo, but so far was not able to do that.

Can anyone provide a short C# example to make EventBox transparent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:53:35+00:00Added an answer on June 11, 2026 at 12:53 am

    Answering my own question…:

    The solution is so simple, while I was looking for complex code to redraw the widget…
    All that needs to be done is to set the EventBox.VisibleWindow member to ‘false’ (it is ‘true’ by default). Than the EventBox is not drawn and if the image inside the EventBox has transparent areas, they will show what ever is below.

    In the example below, it is:
    mapBox.VisibleWindow = false;
    and
    pinBox.VisibleWindow = false;

    As far as I could see, the Z-Order (which Widget is on top of which) is determined by the order of drawing on the screen (when the EventBox is not drawn, the EventBox.GdkWindow.Lower() or Raised() members are not doing anything).

    Example:

    // Showing a map in an invisible EventBox
    EventBox mapBox = new EventBox();
    mapBox.Visible = true;
    mapBox.VisibleWindow = false;
    fixed1.Add(mapBox);
    fixed1.Move (mapBox, 0, 0);
    
    Image mapImage = new Image("map.png");
    mapImage.Visible = true;
    mapBox.Add (mapImage);
    
    // Showing a pin image with transparent areas, in an invisible EventBox, on top of the map
    EventBox pinBox = new EventBox();
    pinBox.Visible = true;
    pinBox.VisibleWindow = false;
    fixed1.Add(pinBox);
    fixed1.Move (pinBox, 60, 60);
    
    Image pinImage = new Image("redpin.png");
    pinImage.Visible = true;
    pinBox.Add (pinImage);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a PNG image from 4 parts of another PNG image
i need to create a object Image from import javax.microedition.lcdui.Image; using a file .png
I need to create button programatically with an image for normal and highlighted state
I need to create a fading background image that stretches to fill the browser.
I need to create a drag and drop system in swing where an image
I need to create a simple mySQL database with a field for an image.
I need to create some mini-windows, like the ones shown in the image bellow,
I need to create the same sprite, with the same image, like 50 -
According to this question I succeeded to create upload image, but now I need
How can I create a barcode image in Java? I need something that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.