Your drawings are Objects in GDI+

Hi all .Net developers and programmers.

If you’re a .Net developer or a programmer you must have heard of the Drawing namespace in System namespace, and you maybe used it to draw in your applications.

For those who used them they must have found that moving a single shape in a scene using simple code is not that easy, you’ll have to redraw the whole scene with the shape in its new location, the same thing happens for rotating and scaling a shape, so I had an idea, “Why can’t we just write Rectangle.Move(X,Y) and it moves? Why should I remember every shape coordinates to redraw a small shape in a new position?” so I answered the question.

I developed a small class that lets you manipulate your drawings as Objects, I mean that you can define a rectangle and just write Rectangle.Move(x,y) and it’ll move to the given position without much hard-coding, I defined (Rectangle, Ellipse, Lines), but you can also define your own shape, you just have to inherit the base class (MagicGraphics.Shape) and you’ll have to write your own Render sub (void) and ToString function, and you can add as much as you want of properties.

All the shapes you draw must be placed in a ShapeContainer that handles the drawing according to the Z-Order between shapes.

The following links are for the class and the testing project in VB .Net 2005:

The Class –    The Testing Project.

The testing project shows how to draw, rotate and move shapes, you can start using my class directly after downloading it.

P.S.: The whole project is still Beta but I wanted to share the first build with you.

Have fun, and please tell me what do you think.

2 thoughts on “Your drawings are Objects in GDI+

  1. Hey mate, nice Blog!
    Why have you stopped blogging?
    It’s not that much time consuming, you can blog whenever you have spare time 😉

    BTW, 1,075 hits for a single post (WOW) 🙂

  2. Welcome here dude 😀
    I know that it’s not that time consuming, and I have already blogged about 4 blogs but in my website, which was deleted – The hosting company deleted my website – 🙁
    Actually it’s not 1,075, it’s 1,081 till now 😀

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.