Hello,
I need to view each pixel's color in CMYK (as opposed to RGB)
If you can get the RGB data, you can convert it to CMYK color,
double R = R / 255
double G = G / 255
double B = B / 255
double K = 1 - Math.Max(R, Math.Max(G, B));
double C = (1 - R - K) / (1 - K)
double M = (1 - G - K) / (1 - K)
double Y = (1 - B - K) / (1 - K)
I also need to be able to rotate & crop the Bitmap.
For crop the Bitmap, you can ceate a new bitmap , set start cropped postion in X, Y axis and cropped bitmap's width and height.
public Bitmap CropImage(Bitmap bitmap,int x, int y ,int width, int height)
{
Android.Graphics.Bitmap crop = Android.Graphics.Bitmap.CreateBitmap(bitmap, x, y, width, height);
return crop;
}
For rotate the bitmap. You can use Matrix
to achieve.
public Bitmap RotateImage(Bitmap image, int width, int height)
{
var matrix = new Matrix();
matrix.PostRotate(90);
return Bitmap.CreateBitmap(image, 0, 0, image.Width, image.Height, matrix, true);
}
As note:Avoid duplicate questions
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.