Struct Rectangle

Struct Rectangle

Namespace: Aspose.OCR
Assembly: Aspose.OCR.dll (25.1.0)

เก็บชุดของจำนวนเต็มสี่ตัวที่แสดงถึงตำแหน่งและขนาดของสี่เหลี่ยมผืนผ้า

public struct Rectangle

สมาชิกที่สืบทอด

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

ตัวสร้าง

Rectangle(int, int, int, int)

สร้างอินสแตนซ์ใหม่ของโครงสร้าง Aspose.OCR.Rectangle โดยมีตำแหน่งและขนาดที่กำหนด

public Rectangle(int x, int y, int width, int height)

พารามิเตอร์

x int

พิกัด x ของมุมซ้ายบนของสี่เหลี่ยมผืนผ้า

y int

พิกัด y ของมุมซ้ายบนของสี่เหลี่ยมผืนผ้า

width int

ความกว้างของสี่เหลี่ยมผืนผ้า

height int

ความสูงของสี่เหลี่ยมผืนผ้า

ฟิลด์

Height

ความกว้างของสี่เหลี่ยมผืนผ้า

public int Height

ค่าฟิลด์

int

Width

ความสูงของสี่เหลี่ยมผืนผ้า

public int Width

ค่าฟิลด์

int

X

ตำแหน่ง x ของสี่เหลี่ยมผืนผ้า

public int X

ค่าฟิลด์

int

Y

ตำแหน่ง y ของสี่เหลี่ยมผืนผ้า

public int Y

ค่าฟิลด์

int

คุณสมบัติ

Bottom

รับหรือกำหนดพิกัด y ซึ่งเป็นผลรวมของค่า Aspose.OCR.Rectangle.Y และ Aspose.OCR.Rectangle.Height ของโครงสร้าง Aspose.OCR.Rectangle นี้

public int Bottom { get; set; }

ค่าคุณสมบัติ

int

Empty

รับอินสแตนซ์ใหม่ของโครงสร้าง Aspose.OCR.Rectangle ที่มีค่า Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width และ Aspose.OCR.Rectangle.Height ตั้งค่าเป็นศูนย์

public static Rectangle Empty { get; }

ค่าคุณสมบัติ

Rectangle

IsEmpty

รับค่าที่บ่งชี้ว่าคุณสมบัติเลขทั้งหมดของ Aspose.OCR.Rectangle นี้มีค่าเป็นศูนย์หรือไม่

public bool IsEmpty { get; }

ค่าคุณสมบัติ

bool

Left

รับหรือกำหนดพิกัด x ของขอบซ้ายของโครงสร้าง Aspose.OCR.Rectangle นี้

public int Left { get; set; }

ค่าคุณสมบัติ

int

Right

รับหรือกำหนดพิกัด x ซึ่งเป็นผลรวมของค่า Aspose.OCR.Rectangle.X และ Aspose.OCR.Rectangle.Width ของโครงสร้าง Aspose.OCR.Rectangle นี้

public int Right { get; set; }

ค่าคุณสมบัติ

int

Top

รับหรือกำหนดพิกัด y ของขอบบนของโครงสร้าง Aspose.OCR.Rectangle นี้

public int Top { get; set; }

ค่าคุณสมบัติ

int

วิธีการ

Contains(int, int)

ตรวจสอบว่าจุดที่กำหนดอยู่ภายในโครงสร้าง Aspose.OCR.Rectangle นี้หรือไม่

public bool Contains(int x, int y)

พารามิเตอร์

x int

พิกัด x ของจุดที่ต้องการทดสอบ

y int

พิกัด y ของจุดที่ต้องการทดสอบ

คืนค่า

bool

วิธีนี้จะคืนค่า true หากจุดที่กำหนดโดย x และ y อยู่ภายในโครงสร้าง Aspose.OCR.Rectangle นี้; มิฉะนั้นจะคืนค่า false

Equals(object)

ทดสอบว่า obj เป็นโครงสร้าง Aspose.OCR.Rectangle ที่มีตำแหน่งและขนาดเดียวกับโครงสร้าง Aspose.OCR.Rectangle นี้หรือไม่

public override bool Equals(object obj)

พารามิเตอร์

obj object

System.Object ที่ต้องการทดสอบ

คืนค่า

bool

วิธีนี้จะคืนค่า true หาก obj เป็นโครงสร้าง Aspose.OCR.Rectangle และคุณสมบัติ Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width และ Aspose.OCR.Rectangle.Height ของมันเท่ากับคุณสมบัติที่สอดคล้องกันของโครงสร้าง Aspose.OCR.Rectangle นี้; มิฉะนั้นจะคืนค่า false

GetHashCode()

คืนค่าแฮชโค้ดสำหรับโครงสร้าง Aspose.OCR.Rectangle นี้

public override int GetHashCode()

คืนค่า

int

จำนวนเต็มที่แสดงถึงแฮชโค้ดสำหรับสี่เหลี่ยมผืนผ้านี้

ToString()

แปลงคุณสมบัติของ Aspose.OCR.Rectangle นี้เป็นสตริงที่อ่านได้โดยมนุษย์

public override string ToString()

คืนค่า

string

สตริงที่มีตำแหน่ง ความกว้าง และความสูงของโครงสร้าง Aspose.OCR.Rectangle นี้

ตัวดำเนินการ

operator ==(Rectangle, Rectangle)

ทดสอบว่าสองโครงสร้าง Aspose.OCR.Rectangle มีตำแหน่งและขนาดเท่ากันหรือไม่

public static bool operator ==(Rectangle left, Rectangle right)

พารามิเตอร์

left Rectangle

โครงสร้าง Aspose.OCR.Rectangle ที่อยู่ทางซ้ายของตัวดำเนินการเปรียบเทียบ

right Rectangle

โครงสร้าง Aspose.OCR.Rectangle ที่อยู่ทางขวาของตัวดำเนินการเปรียบเทียบ

คืนค่า

bool

ตัวดำเนินการนี้จะคืนค่า true หากสองโครงสร้าง Aspose.OCR.Rectangle มีคุณสมบัติ Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width และ Aspose.OCR.Rectangle.Height เท่ากัน

operator !=(Rectangle, Rectangle)

ทดสอบว่าสองโครงสร้าง Aspose.OCR.Rectangle แตกต่างกันในตำแหน่งหรือขนาดหรือไม่

public static bool operator !=(Rectangle left, Rectangle right)

พารามิเตอร์

left Rectangle

โครงสร้าง Aspose.OCR.Rectangle ที่อยู่ทางซ้ายของตัวดำเนินการไม่เท่ากัน

right Rectangle

โครงสร้าง Aspose.OCR.Rectangle ที่อยู่ทางขวาของตัวดำเนินการไม่เท่ากัน

คืนค่า

bool

ตัวดำเนินการนี้จะคืนค่า true หากคุณสมบัติ Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width หรือ Aspose.OCR.Rectangle.Height ของสองโครงสร้าง Aspose.OCR.Rectangle ไม่เท่ากัน; มิฉะนั้นจะคืนค่า false

 แบบไทย