473,624 Members | 2,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Drawing. Size unit

Hi,

what is the unit of System.Drawing. Size?

when i'm writing Size = (1024,784), is it pixel? or something else?

Thanks,
Sep 28 '07 #1
2 13088
its dont have any specific unit .its only take the value height and width in
int.

"Gidi" wrote:
Hi,

what is the unit of System.Drawing. Size?

when i'm writing Size = (1024,784), is it pixel? or something else?

Thanks,
Sep 28 '07 #2
Gidi wrote:
what is the unit of System.Drawing. Size?

when i'm writing Size = (1024,784), is it pixel? or something else?
It depends on the context. For Control properties (Size, Bounds,
ClientRectangle , etc), it's pixels. But for drawing, when the Size is
passed to something operating on a Graphics object, the Size is
interpreted according to the PageUnit property of that Graphics object.
So it could be any of the units found in the GraphicsUnit enumeration
except World, in that case.

Note of course also that a Graphics can have a transformation applied to
it, so any drawing using a Size is also affected by that. If the
PageUnit is Pixels, but you've got a 50% scaling factor applied, then
any Size you pass to a Graphics object winds up being in half-pixels
rather than whole pixels.

All the above is true for the Point struct too.

Pete
Sep 28 '07 #3

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

Similar topics

7
7458
by: WALDO | last post by:
I have an interesting quandary. I have developed a program in VB.Net to extract an icon resource from an exe/dll or from an ico file and enumerate its formats (16x16,256 color;32x32,true color;etc.). It reads out the structures all the way down to the ICONIMAGE structures. I have this represented as an array of bytes read from the resource. I am using the unmanaged function CreateIconFromResourceEx to generate an hIcon pointer. I take...
1
3222
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To get the best performance for the utility class, its members, as well as the System.Drawing.Graphics object, are static:
5
4359
by: hzgt9b | last post by:
I'm building a dataset that writes out a Point type value. Here's the code that I've got: 1 Dim dsContent As DataSet = New DataSet("content") 2 Dim dtAsset As DataTable = New DataTable("asset") 3 Dim dcPk(0) As DataColumn 4 dcPk(0) = _ 5 dtAsset.Columns.Add("fullName", Type.GetType("System.String")) 6 dtAsset.Columns.Add("videoLocation", Type.GetType("System.Drawing.Point"))
5
3363
by: Jerry J | last post by:
I want to use the System.Drawing.Image class. According to the help file, this is an abstract base class. Because it is supposedly abstract, I created another class that inherits from it. However, when I did this I got the following error: 'System.Drawing.Image.Image()' is inaccessible due to its protection level Looking at other online examples, I found that the proper way to use it is like this:
1
2694
by: Martijn Mulder | last post by:
At startup my application loads an image from a file from disk. If the file is not there, I still need a valid System.Drawing.Image object but I don't know how to get one. //class MyImage class MyImage { //data member image
1
9441
by: Marc the Demi-Programmer | last post by:
I am overriding WncProc to make sure my form's location stays within specified parameters. Basically, it has to stay at the top of the screen and not be off to either of the sides. All that works when the form is in its minimal size. However, when the form is maximized using the appropriate button the code that is supposed to set the location is ignored. When the form is switched back to the standard dimensions through the restore...
2
7713
by: piercy | last post by:
The project im working on requires the user to be able to print reports based on information the program gathers. (ie.To, From, Cost, Username etc.etc.). Now to make this report thing more usable im going to add lots of customizable options. For instance, row color, font size, font type, font color, header color etc. So i added the fontDialog control to my page and for time being just called ShowDialog on a button click. Theres an...
2
2327
by: ThatsIT.net.au | last post by:
I have this code that writes a pie chart in a asp.net page, but I want to use it in a server control. When I try I get a error on the last line "Response.OutputStream" Obviously there is no response object but how do I write it to screen? Dim objBitmap As New System.Drawing.Bitmap(400, 440) Dim objGraphics As System.Drawing.Graphics objGraphics = System.Drawing.Graphics.FromImage(objBitmap) objGraphics.Clear(Drawing.Color.White)
2
3269
by: ouzsharp | last post by:
The follwing class works well when used in a C# console application: namespace ScreenShotDemo { /// <summary> /// Provides functions to capture the entire screen, or a particular window, and save it to a file. /// </summary> public class ScreenCapture {
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.