Rectangle
-
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...
-
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...
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
-
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
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