I'm porting my current (Silverlight) WP8.0 app to a Universal Windows application. In this application I have a control that allows the user to use a custom dial control. When the dial stops, the app should get the pixel color from that specific point (and underlaying image).
In WP8.0, I used to do the following:
WriteableBitmap wb = new WriteableBitmap(ColorWheelImage, null);
Color c = wb.GetPixel(pointX, pointY);
ColorWheelImage is in the XAML.
In WinRT the WriteableBitmap only support new WriteableBitmap(int pixelWidth, int pixelWidth)
and not setting an image like in Silverlight.
How can I fix this.. I can't seem to figure it out :(!
Thanks, Niels
In WinRT,
WriteableBitmap
is unable to draw visuals. Instead, MS added new controlRenderTargetBitmap
.But
GetPixelsAsync()
gives youIBuffer
, instead of int array. To get an ordinalWriteableBitmap
, you can use WriteableBitmapEx.