GetM

CmykColorHelper.GetM method

يحصل على قيمة المكون الأرجواني .

public static int GetM(int cmyk)
معامليكتبوصف
cmykInt32يتم تقديم لون CMYK كقيمة عدد صحيح 32 بت.

قيمة الإرجاع

قيمة المكون الأرجواني.

أمثلة

يوضح المثال التالي كيفية تحويل ألوان RGB إلى نظيراتها في CMYK بدون تطبيق ملفات تعريف ICC.

[C#]

Aspose.Imaging.Color[] rgbColors = new Aspose.Imaging.Color[]
{
    Aspose.Imaging.Color.Red,
    Aspose.Imaging.Color.Green,
    Aspose.Imaging.Color.Blue,
};

System.Console.WriteLine("Convert RGB to CMYK without using ICC profiles.");
foreach (Aspose.Imaging.Color rgbColor in rgbColors)
{
    int cmyk = Aspose.Imaging.CmykColorHelper.ToCmyk(rgbColor);
    int c = Aspose.Imaging.CmykColorHelper.GetC(cmyk);
    int m = Aspose.Imaging.CmykColorHelper.GetM(cmyk);
    int y = Aspose.Imaging.CmykColorHelper.GetY(cmyk);
    int k = Aspose.Imaging.CmykColorHelper.GetK(cmyk);

    System.Console.WriteLine("RGB({0},{1},{2})\t\t=> CMYK({3},{4},{5},{6})", rgbColor.R, rgbColor.G, rgbColor.B, c, m, y, k);
}

// يبدو الإخراج كالتالي:
// تحويل RGB إلى CMYK بدون استخدام ملفات تعريف ICC.
// RGB (255،0،0) = > ; CMYK (0،255،255،0)
// RGB (0،128،0) = > ; CMYK (255،0،255،127)
// RGB (0،0،255) = > ; CMYK (255،255،0،0)

يوضح المثال التالي كيفية تحويل ألوان CMYK إلى نظيراتها من RGB بطريقة سريعة باتباع الصيغ المباشرة دون استخدام ملفات تعريف ICC.

[C#]

int[] cmykColors = new int[]
{
    Aspose.Imaging.CmykColorHelper.FromComponents(255, 0, 0, 0),   // ازرق سماوي
    Aspose.Imaging.CmykColorHelper.FromComponents(0, 255, 0, 0),   // أرجواني
    Aspose.Imaging.CmykColorHelper.FromComponents(0, 0, 255, 0),   // الأصفر
    Aspose.Imaging.CmykColorHelper.FromComponents(0, 0, 0, 255),   // أسود
};

System.Console.WriteLine("Convert CMYK to RGB without using ICC profiles.");
foreach (int cmykColor in cmykColors)
{
    Aspose.Imaging.Color rgbColor = Aspose.Imaging.CmykColorHelper.ToArgb(cmykColor);
    int c = Aspose.Imaging.CmykColorHelper.GetC(cmykColor);
    int m = Aspose.Imaging.CmykColorHelper.GetM(cmykColor);
    int y = Aspose.Imaging.CmykColorHelper.GetY(cmykColor);
    int k = Aspose.Imaging.CmykColorHelper.GetK(cmykColor);

    System.Console.WriteLine("CMYK({0},{1},{2},{3})\t\t=> RGB({4},{5},{6})", c, m, y, k, rgbColor.R, rgbColor.G, rgbColor.B);
}

// يبدو الإخراج كالتالي:
// تحويل CMYK إلى RGB بدون استخدام ملفات تعريف ICC.
// CMYK (255،0،0،0) = > ; RGB (0،255،255)
// CMYK (0،255،0،0) = > ; RGB (255،0،255)
// CMYK (0،0،255،0) = > ; RGB (255،255،0)
// CMYK (0،0،0،255) = > ; RGB (0،0،0)

أنظر أيضا