Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

System.Drawing.Size unit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gidi - 28 Sep 2007 10:58 GMT
Hi,

what is the unit of System.Drawing.Size?

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

Thanks,
Som Nath Shukla - 28 Sep 2007 11:25 GMT
its dont have any specific unit .its only take the value height and width in
int.

> Hi,
>
[quoted text clipped - 3 lines]
>
> Thanks,
Peter Duniho - 28 Sep 2007 17:37 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.