System.Drawing.Size unit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?R2lkaQ==?=

    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,
  • =?Utf-8?B?U29tIE5hdGggU2h1a2xh?=

    #2
    RE: System.Drawing. Size unit

    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,

    Comment

    • Peter Duniho

      #3
      Re: System.Drawing. Size unit

      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

      Comment

      Working...