Hack Forums
[.NET] How to Set Rectangle location properties? (Old Way) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] How to Set Rectangle location properties? (Old Way) (/showthread.php?tid=5408882)



How to Set Rectangle location properties? (Old Way) - 4h35i13n46u7 - Sep 18, 2016

Oh yes, I saw this = https://msdn.microsoft.com/en-us/library/system.drawing.rectangle(v=vs.110).aspx

Dim recta As New Rectangle
'It says these properties are Read-only.
recta.Left =
recta.Bottom =
recta.Right =
recta.Top =

And my problem is, I want to use these properties to set values :-/
Because i have values in this format. Many!
And so i guess, i am in a problem. ^_^

I saw the example..
Dim blackPen As New Pen(Color.FromArgb(255, 0, 0, 0), 5)
e.Graphics.DrawRectangle(blackPen, 10, 10, 100, 50)

How do i..
e.Graphics.DrawRectangle(left-x, bottom-y, right-x, top-y)

Instead of..
e.Graphics.DrawRectangle(blackPen, 10, 10, 100, 50)

?

OR

Is there anyway to convert locations?
E.G
1) 2694 to 9 'A Y co-ordinate
2) 2706 to 12 'A height
?

Because i want only the 'Y' and 'Height' converted.

[img]http://s16.postimg.org/6a1tt037p/help.jpg[/img]

Please Help! Please. Please.
Thankyou.


* - Zilog80 - Sep 18, 2016

Hmmm...I don't understand your question.
Rectangle can be defined as:

PHP Code

<?php 
Dim myRect 
As Rectangle = New Rectangle(some constructors here. Use your best choice) 



* - Ninja - Sep 18, 2016

Why do you need to set the properties instead of via the constructor?
And what are you doing with Tesseract? You can just make tessdata and use that.