all groups > dotnet drawing api > august 2006 >
You're in the

dotnet drawing api

group:

Creating a visual object



Creating a visual object Ant
8/21/2006 11:22:01 PM
dotnet drawing api: Hi, I don't know if this is the right thread. I'm actually working on a
simple graph tool seeing as though .NET doesn't come with one.

I have a control which I want to add bar objects to. I need the bar objects
to have certain properties like height, width, colour etc. Sounds like a
rectangle to me.

I thought of inheriting the rectangle class but it seems this is only a
class that holds values, not a visual representation.

How can I create a rectangle? Must I use a control template to do this?

Completely lost...

Thanks for any ideas.

Re: Creating a visual object Michael C
8/22/2006 12:00:00 AM
[quoted text, click to view]

In the paint event or override

e.Graphics.DrawRectangle(.....)

[quoted text, click to view]

Re: Creating a visual object James Westgate
8/22/2006 3:35:12 PM
You need a retained mode graphics system which you can then use to
create simple elements such as Rectangle etc which persist information
and which you can use to build up useful classes of shapes and
functions. An example is availabel at www.bobpowell.net.

Or you may just want to draw onto bitmaps using the graphics.Drawxx
functions

James

[quoted text, click to view]
AddThis Social Bookmark Button