Resizable graphics elements, scaling, etc...

  • Thread starter Thread starter mookid8000
  • Start date Start date
M

mookid8000

Hi group!

I want to make a program with options similar to those in Microsoft
Publisher - i.e. the ability to create different types of rectangle
objects in which pictures/text/whatever may be embedded.

In my first attempt an element inherits from UserControl. But this
gives me the following problems:
1) Transparency. UserControls cannot have transparent portions, so it
is not possible to create a text element with a transparent background.
2) Scaling. I want to make the view of the page scalable, so that
resizing the window and zooming in on portions of the view is possible.
I've messed around with the Scale of my Form, but I guess this will
affect everything inside the form - I just want it to affect my
graphics elements.

Is there any classes in .NET which implements something like this? Or
is it easier to create my own element superclass with all the
functionality I need?

Thanks in advance!
-Mogens
 
Hi group!

I want to make a program with options similar to those in Microsoft
Publisher - i.e. the ability to create different types of rectangle
objects in which pictures/text/whatever may be embedded.

In my first attempt an element inherits from UserControl. But this
gives me the following problems:
1) Transparency. UserControls cannot have transparent portions, so it
is not possible to create a text element with a transparent background.
2) Scaling. I want to make the view of the page scalable, so that
resizing the window and zooming in on portions of the view is possible.
I've messed around with the Scale of my Form, but I guess this will
affect everything inside the form - I just want it to affect my
graphics elements.

Is there any classes in .NET which implements something like this? Or
is it easier to create my own element superclass with all the
functionality I need?

Thanks in advance!
-Mogens

From my experience the best approach is to paint it yourself. A good
point to start is to override the OnPaint() method of your form/control.

HTH,
Andy
 
Thanks for the suggestion!

I did exactly that, and I have pretty much written the whole thing by
now. It works like a charm!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top