problem with graphics overlaying an image

csharp Erode, India
  • 13 years ago

    I have an application where I want to add graphics onto the form based on mouse clicks. I want to add a small ellipse over an image where I click it.

    I have got the hardest bit done I think as I can get the graphics to display where I click the mouse. The problem I'm having is it won't draw the graphics over the Imagebox only the actual form itself.

    Is this because I'm using an image box or is it something to do with it being layered behind the Imagebox?

    Has anyone come accross this problem?


  • 13 years ago

    As far as i'm aware there's no such thing as an ImageBox.  Do you mean a PictureBox?  Using the correct names for things is good.

    You may want to check out a simple drawing demo I created.  It uses a PictureBox to create temporary and permanent lines.  You can easily extend it to create any shapes you want.  The code is VB but the principles are exactly the same, plus this site has a code conversion utility.


  • 13 years ago

    Yeah Picturebox sorry, was images on the brain yesterday trying to get that working. Thanks for replying checking out that link now. Will let you know how I get on.

  • 13 years ago

    Got that working ok thanks again for your help. I was using the Graphics object for the form rather than loading the PictureBox into a new Graphics object. Makes sense when I think on it but with my inexperience with images and graphics was making simple errors.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”