471,627 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Resizable graphics elements, scaling, etc...

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

Dec 13 '05 #1
2 1382
mo********@gmail.com wrote:
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
Dec 13 '05 #2
Thanks for the suggestion!

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

Dec 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by johannblake | last post: by
1 post views Thread by placid | last post: by
4 posts views Thread by Andrew | last post: by
11 posts views Thread by Aaron Gray | last post: by
1 post views Thread by =?Utf-8?B?bXIgcGVhbnV0?= | last post: by
15 posts views Thread by Eric Lindsay | last post: by
6 posts views Thread by jt | last post: by
3 posts views Thread by RgeeK | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.