muak / Xamarin.Plugin.ImageEdit

Image Edit Plugin for Xamarin
MIT License
55 stars 16 forks source link

Is it possible to get pixel color based on X, Y position? #8

Closed Jbonavita closed 6 years ago

Jbonavita commented 6 years ago

I have a case where I need to get the pixel color the user clicked on. Is it possible to do that?

Thanks!

muak commented 6 years ago

@Jbonavita Though I don't try whether it works in reality, for example, how about the following code?

var pixels = image.ToArgbPixels();
var pos = y * image.Width + x;
var pixel = pixels[pos];
Jbonavita commented 6 years ago

Thanks. I haven't been able to figure out a way to call CreateImageAsync from an Image or ImageSource.