• (2 Pages)
  • +
  • 1
  • 2

The wonders of System.Drawing.Graphics

#16 wyoknott1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 28-May 09

Posted 24 May 2011 - 10:42 AM

I cannot get the following code to work. I get no errors but I get no circle on the form that is drawn.

private void Form1_Shown(object sender, EventArgs e)
        {
            System.Drawing.Graphics GraphicsObject = Graphics.FromHwnd(this.Handle);  

            GraphicsObject.FillEllipse(Brushes.Red, new Rectangle(0, 0, 100, 100)); 

        }



What am I doin wrong?
Was This Post Helpful? 0
  • +
  • -

#17 Lurler  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 29
  • Joined: 30-May 11

Posted 31 May 2011 - 08:05 AM

Can this class be used to:
* draw rotated images, I mean rotate original image and draw it, like for example in xna
* use alpha image to specify alpha areas on the main image
* use arbitrary alpha parameters

?
Was This Post Helpful? 0
  • +
  • -

#18 George Potter  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 06-October 11

Posted 05 March 2012 - 09:09 AM

This is brilliant - it's made my life a lot easier.

Out of curiosity, anyone know how to draw on top of an existing image? Or do you have to modify an existing image and then save it again and display the altered version?
Was This Post Helpful? 0
  • +
  • -

#19 George Potter  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 06-October 11

Posted 05 March 2012 - 10:19 AM

Never mind, I've figured out that what I need to do is to alter the properties of the form to have the image set as the background and then draw inside the form.
Was This Post Helpful? 0
  • +
  • -

#20 hkn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-May 09

Posted 31 January 2013 - 06:26 AM

Very useful post. Thank you.

This post has been edited by Atli: 21 September 2013 - 02:40 AM
Reason for edit:: Quote removed. Please try not to quote the ENTIRE tutorial when posting comments.

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2