473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 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 1449
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters...
12
by: EricJ | last post by:
back at the saturday job ;) all help is welcome ( if there is an other way of doing this i don't mind as long as it works) i have to compose an image in code. I have a background image (a...
1
by: placid | last post by:
Hi all, This is the following code i have, Public Class Form1 Inherits System.Windows.Forms.Form Dim A, B, c, U, x, y As Double Dim Red, Green, Blue As Integer
4
by: Andrew | last post by:
Hi, I'm trying to blit small bitmaps onto a larger bitmap, and I've got a few issues wrt positioning and output size. I think my problems are due to DPI differences... My small images are...
11
by: Aaron Gray | last post by:
Hi, I have put together a bit of JavaScript to make a square resizable canvas :- http://www.aarongray.org/Test/JavaScript/resizable.html Problems I have :- a) I cannot seem to center it...
1
by: =?Utf-8?B?bXIgcGVhbnV0?= | last post by:
My application requires user interaction with a graphics interface that is changing (data is being collected and plotted). Sometimes the graphics updates are slow and the user is locked out until...
15
by: Eric Lindsay | last post by:
I need to include some simple (sparkline style) graphs in a web page that will have a liquid layout. Some viewers will be changing the font size to suit their display (sizes range from 320 to 2560...
6
by: jt | last post by:
i think i was not clear in my quesiton. my question actually was how to store a graphics image generated in C. Eg. #include<graphics.h> void main() { int gm,gd=DETECT; initgraph(&gd,&gm,"");...
3
by: RgeeK | last post by:
Experimenting with graphics in an app: it's AUI based with a few panes, one of which has a panel containing a few sizers holding UI elements. One sizer contains a panel that needs some basic...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.