473,387 Members | 1,693 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,387 software developers and data experts.

GraphicUnits and scaling a picturebox

I have a usercontrol that contains a picturebox. The user can obtain
(creategraphics) a picturebox graphics object and draw on the picturebox.
She could do gr.GraphincInit.Millimeter and then draw using millimeters as
the measurement.

But he would still have to dimension the Picture box using pixels
(Clientsize for example). He changes the picture box dimensions via
usercontrol properties so I could scale them going in and out.

Couple of questions:
I'm quite sure the user has to tell the usercontrol what units he is using.
I mean the picturebox has no idea what has been changed in the graphics
object it gave the user. Right?

The usercontrol gets the graphics object from the picturebox and gives it to
the user. I suppose it could keep a copy of it and check to see what the
units are when it needs to. Is that correct?

Could the user obtain more then one graphics object and set them to
different units and use them alternately. The above would remove that as an
option. If this is true maybe a better way is for the user to set a units
property in the usercontrol.(He could then set it depending on which
graphics object is to be used.) Not nice but do you think this would work?

Say it's set to millimeters. When the user later sets the picturebox width
(for example) by giving milimeterers the usercontrol would convert to
inches, do a creatgraphics on the picturebox and get DPI and then calculate
the width in pixels and set it.

Seems like a lot of trouble so I want to be sure I'm not missing something
(like Dotnet can do it all by ...)
Also to set the picturebox width do I do a creatgraphics on the box or on
the usercontrol.
Thanks for any insight passed along

Nov 20 '05 #1
0 1609

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jeff | last post by:
Hiya, Im currently in the process of developing a picture browser, I want it to run off a CD, basically I have 2 questions for the group. The first is how do I get the program to only view the...
2
by: Bent F | last post by:
Going from VB6 to VB.NET i have lost the capability to do the most simple things... In VB6 scaling a picturebox was done like this: Me.picturebox.scale (0,25)-(25,0) How is it done in...
4
by: midicad2001 | last post by:
I have been researching this issue and have come across a number of solutions apparently written for VB5 or 6 and don't work under .NET, yes folks that is progress! Someone in this ng suggested...
17
by: IanIpp | last post by:
We have a 3 month old quad processor/dual core server running SQL Server 2005 and already it is getting close to hitting the CPU wall. An 8 way CPU box is prohibitively expensive and out of the...
0
by: Brahm | last post by:
Going from VB6 to VB.NET i have lost the capability to do the most simple things... In VB6 scaling a picturebox was done like this: Me.picturebox.scale (0,25)-(25,0) How is it done in VB.NET...
1
by: John | last post by:
I have an app where I want to show an icon in a large PictureBox. I've set the SizeMode to Zoom but the icon image is extremely fuzzy because the scaling up also anti-aliases. Is there a way to...
1
by: Eric | last post by:
Hi, I'm writing a program that based on input will create a document. It is something simulair as a printing example. In MS Word when you click on the shown document you can zoom in and if you...
2
by: =?Utf-8?B?Sm9uIFBhcnJ5?= | last post by:
Hi, I've got a Picturebox, into which I am putting a frame bitmap from a video camera. The camera bitmap is larger than the picturebox, which has SizeMode set to "Zoom" which causes the bitmap...
6
by: TEN Ware | last post by:
I have written an app in VB2005. This app uses a picturebox that is 256x256 pixels. It looks fine on the PC on which the app was developed. When I run the app on another PC, the picture box...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.