Class ColorPalette

Class ColorPalette

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)

מגדיר מערך של צבעים שמרכיבים פלטת צבעים. הצבעים הם צבעי ARGB באורך 32 סיביות. לא ניתנים להורשה.

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

ירושה

objectColorPalette

מיישם

IColorPalette

חברים שהורשו

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

קונסטרקטורים

ColorPalette(int[], bool)

מאתחל מופע חדש של מחלקת Aspose.Imaging.ColorPalette.

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

פרמטרים

argb32Entries int[]

הכניסות של פלטת צבעי ARGB באורך 32 סיביות.

isCompactPalette bool

מציין אם הפלטה היא פלטה קומפקטית.

ColorPalette(int[])

מאתחל מופע חדש של מחלקת Aspose.Imaging.ColorPalette ו-IsCompactPalette הוא false.

public ColorPalette(int[] argb32Entries)

פרמטרים

argb32Entries int[]

הכניסות של פלטת צבעי ARGB באורך 32 סיביות.

ColorPalette(Color[], bool)

מאתחל מופע חדש של מחלקת Aspose.Imaging.ColorPalette.

public ColorPalette(Color[] entries, bool isCompactPalette)

פרמטרים

entries Color[]

הכניסות של פלטת הצבעים.

isCompactPalette bool

מציין אם הפלטה היא פלטה קומפקטית.

ColorPalette(Color[])

מאתחל מופע חדש של מחלקת Aspose.Imaging.ColorPalette ו-IsCompactPalette הוא false.

public ColorPalette(Color[] entries)

פרמטרים

entries Color[]

הכניסות של פלטת הצבעים.

מאפיינים

Argb32Entries

מקבל מערך של מבני ARGB באורך 32 סיביות.

public int[] Argb32Entries { get; }

ערך המאפיין

int[]

Entries

מקבל מערך של מבני Aspose.Imaging.Color.

public Color[] Entries { get; }

ערך המאפיין

Color[]

EntriesCount

מקבל את מספר הכניסות.

public int EntriesCount { get; }

ערך המאפיין

int

IsCompactPalette

מקבל או קובע ערך המצביע אם משתמשים בפלטה קומפקטית.

public bool IsCompactPalette { get; }

ערך המאפיין

bool

הערות

פלטה קומפקטית פירושה שהתמונה תכיל רק את הכניסות של הפלטה המצוינות אם זה אפשרי, או במילים אחרות התמונה תהיה יותר קומפקטית ותתפוס פחות מקום; אחרת יהיו 2^BitsPerPixel כניסות והתמונה תתפוס יותר מקום עבור כל הכניסות האפשריות של הפלטה. הגדרת ערך זה ל-true ושינוי הכניסות של הפלטה עשויים לגרום לעונש בביצועים מכיוון שייתכן שתתרחש העברת נתונים, לכן השתמש בזה בזהירות.

שיטות

CopyPalette(IColorPalette, bool)

מעתיק את הפלטה.

public static ColorPalette CopyPalette(IColorPalette colorPalette, bool useCompactPalette)

פרמטרים

colorPalette IColorPalette

פלטת הצבעים.

useCompactPalette bool

מציין אם הפלטה היא פלטה קומפקטית.

מחזיר

ColorPalette

הפלטה החדשה שנוצרה והועתקה או null אם פלטה null הועברה.

CopyPalette(IColorPalette)

מעתיק את הפלטה.

public static ColorPalette CopyPalette(IColorPalette colorPalette)

פרמטרים

colorPalette IColorPalette

פלטת הצבעים.

מחזיר

ColorPalette

הפלטה החדשה שנוצרה והועתקה או null אם פלטה null הועברה.

GetArgb32Color(int)

מקבל את צבע הפלטה ARGB באורך 32 סיביות לפי אינדקס.

public int GetArgb32Color(int index)

פרמטרים

index int

אינדקס צבע הפלטה ARGB באורך 32 סיביות.

מחזיר

int

כניסת הפלטה המצוינת על ידי index.

חריגות

ArgumentOutOfRangeException

אם אינדקס הפלטה index המצויין נמצא מחוץ לטווח הכניסות של הפלטה.

GetColor(int)

מקבל את צבע הפלטה לפי אינדקס.

public Color GetColor(int index)

פרמטרים

index int

אינדקס צבע הפלטה.

מחזיר

Color

כניסת הפלטה המצוינת על ידי index.

חריגות

ArgumentOutOfRangeException

אם אינדקס הפלטה index המצויין נמצא מחוץ לטווח הכניסות של הפלטה.

GetNearestColorIndex(int)

מקבל את האינדקס של הצבע הקרוב ביותר.

public int GetNearestColorIndex(int argb32Color)

פרמטרים

argb32Color int

הצבע ARGB באורך 32 סיביות.

מחזיר

int

האינדקס של הצבע הקרוב ביותר.

GetNearestColorIndex(Color)

מקבל את האינדקס של הצבע הקרוב ביותר.

public int GetNearestColorIndex(Color color)

פרמטרים

color Color

הצבע.

מחזיר

int

האינדקס של הצבע הקרוב ביותר.

 Ελληνικά