Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Rectangle

Rectangle

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpc++graphicsquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neil Van Note
    wrote on last edited by
    #1

    I have just started to get my feet wet with .NET (C#) and I just have one question so far... Whose cruel joke was it to make the Left, Top, Right, and Bottom properties of the Rectangle Object READ-ONLY! :mad: Yes, I know the X, Y, Width, and Height are writable, but it doesn't do me much good when I am porting some of my C/C++ drawing code that doesn't think in those terms. Now that I have that of my chest, I feel much better. :) Thanks...

    J 1 Reply Last reply
    0
    • N Neil Van Note

      I have just started to get my feet wet with .NET (C#) and I just have one question so far... Whose cruel joke was it to make the Left, Top, Right, and Bottom properties of the Rectangle Object READ-ONLY! :mad: Yes, I know the X, Y, Width, and Height are writable, but it doesn't do me much good when I am porting some of my C/C++ drawing code that doesn't think in those terms. Now that I have that of my chest, I feel much better. :) Thanks...

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      To make your transition easier could you just create your own rectangle class that falls back on the System.Drawing.Rectangle class when needed? :) If you got really enterprising you could write an implicit operator so it would cast to a S.D.R silently (for using in GDI+ for example). James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

      N 1 Reply Last reply
      0
      • J James T Johnson

        To make your transition easier could you just create your own rectangle class that falls back on the System.Drawing.Rectangle class when needed? :) If you got really enterprising you could write an implicit operator so it would cast to a S.D.R silently (for using in GDI+ for example). James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

        N Offline
        N Offline
        Neil Van Note
        wrote on last edited by
        #3

        Good Idea and something I thought about myself. Although, the code that I am working with at the moment does *allot* of small rectangle adjustments during the drawing and I am a bit worried about what the performance is going to look like under .NET. I am currently starting to re-think things, and either I am going to change the drawing logic (I doubt) and/or, to fall back and to code up a rectangle variant that allows L,T,R,B adjustments and translate those into X,Y,W,H adjustments *auto-magically*. Regards

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups