Class ColorPalette

Class ColorPalette

Tên không gian: Aspose.Imaging Tổng hợp: Aspose.Imaging.dll (25.4.0)

Định nghĩa một loạt các màu sắc tạo thành một bảng màu. Màu sắc là màu sắc 32-bit ARGB. Không di sản.

[JsonObject(MemberSerialization.OptIn)]
public sealed class ColorPalette : IColorPalette

Inheritance

object ColorPalette

Implements

IColorPalette

Thành viên thừa kế

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

Constructors

ColorPalette(int[ ], bool)

Bắt đầu một trường hợp mới của lớp Aspose.Imaging.ColorPalette.

[JsonConstructor]
public ColorPalette(int[] argb32Entries, bool isCompactPalette)

Parameters

argb32Entries int [ ]

Các 32-bit ARGB màu bảng nhập.

isCompactPalette bool

Chỉ định xem nó có nhỏ gọn hay không.

ColorPalette(int[])

Bắt đầu một ví dụ mới của lớp Aspose.Imaging.ColorPalette và IsCompactPalett là giả.

public ColorPalette(int[] argb32Entries)

Parameters

argb32Entries int [ ]

Các 32-bit ARGB màu bảng nhập.

ColorPalette(Color[ ], bool)

Bắt đầu một trường hợp mới của lớp Aspose.Imaging.ColorPalette.

public ColorPalette(Color[] entries, bool isCompactPalette)

Parameters

entries Color [ ]

Màu palet vào.

isCompactPalette bool

Chỉ định xem nó có nhỏ gọn hay không.

ColorPalette(Color[])

Bắt đầu một ví dụ mới của lớp Aspose.Imaging.ColorPalette và IsCompactPalett là giả.

public ColorPalette(Color[] entries)

Parameters

entries Color [ ]

Màu palet vào.

Properties

Argb32Entries

Có một loạt các cấu trúc ARGB 32-bit.

public int[] Argb32Entries { get; }

Giá trị bất động sản

int [ ]

Entries

Có một loạt các cấu trúc Aspose.Imaging.Color.

public Color[] Entries { get; }

Giá trị bất động sản

Color [ ]

EntriesCount

Nhận được số lượng vào.

public int EntriesCount { get; }

Giá trị bất động sản

int

IsCompactPalette

Nhận hoặc đặt một giá trị cho thấy liệu pallet nhỏ gọn được sử dụng hay không.

public bool IsCompactPalette { get; }

Giá trị bất động sản

bool

Remarks

Bảng nhỏ gọn có nghĩa là hình ảnh sẽ chỉ chứa các mục bảng cụ thể nếu có thể hoặc bằng cách nói khác, hình ảnh sẽ nhỏ gọn hơn và chiếm không gian ít hơn;Nếu không, sẽ có 2^BitsPerPixel entries và hình ảnh sẽ đặt thêm không gian cho tất cả các entries palette có thể.Đặt giá trị này vào thực và thay đổi các mục bảng có thể gây phạt hiệu suất vì lưu lượng dữ liệu có thể xảy ra nên sử dụng nó cẩn thận.

Methods

CopyPalette(Màn hình, bool)

Sao chép palette

public static ColorPalette CopyPalette(IColorPalette colorPalette, bool useCompactPalette)

Parameters

colorPalette IColorPalette

Màu palet

useCompactPalette bool

Chỉ định liệu nó có nhỏ gọn hay không.

Returns

ColorPalette

Bảng mới được tạo và sao chép hoặc null nếu null đã qua.

CopyPalette(Đồ chơi ICOLOR)

Sao chép palette

public static ColorPalette CopyPalette(IColorPalette colorPalette)

Parameters

colorPalette IColorPalette

Màu palet

Returns

ColorPalette

Bảng mới được tạo và sao chép hoặc null nếu null đã qua.

GetArgb32Color(int)

Nhận màu palette 32-bit ARGB theo chỉ số.

public int GetArgb32Color(int index)

Parameters

index int

Chỉ số màu 32 bit ARGB.

Returns

int

Nhập bảng màu được chỉ định bởi index'.

Exceptions

ArgumentOutOfRangeException

nếu bảng màu index’ được chỉ định là ngoài phạm vi nhập bảng.

GetColor(int)

Nhận màu palette theo chỉ số.

public Color GetColor(int index)

Parameters

index int

Chỉ số màu palette.

Returns

Color

Nhập bảng màu được chỉ định bởi index'.

Exceptions

ArgumentOutOfRangeException

nếu bảng màu index’ được chỉ định là ngoài phạm vi nhập bảng.

GetNearestColorIndex(int)

Nhận chỉ số của màu sắc gần nhất.

public int GetNearestColorIndex(int argb32Color)

Parameters

argb32Color int

Màu sắc 32 bit ARGB

Returns

int

Chỉ số của màu sắc gần nhất

GetNearestColorIndex(Color)

Nhận chỉ số của màu sắc gần nhất.

public int GetNearestColorIndex(Color color)

Parameters

color Color

Màu sắc

Returns

int

Chỉ số của màu sắc gần nhất

 Tiếng Việt