如何在windows phone 8.1 WinRT的基于摄像头的应用程序上应用颜色效果
本文关键字:应用 应用程序 摄像头 程序上 颜色 phone windows WinRT | 更新日期: 2023-09-27 18:00:59
我正在windows phone 8.1 WinRT上为视障用户开发一个放大应用程序,在放大页面(基于相机(中,我想应用颜色效果和对比度,以获得更多的可访问性(白中黑、蓝中黄、黑中黄、白中黑…(
http://www.1800pocketpc.com/wp-content/uploads/2014/10/Microsoft-Pocket-Magnifier-700x437.jpg
有人知道怎么处理吗?
我相信最简单的方法是使用Lumia Imaging SDK(https://msdn.microsoft.com/en-us/library/dn859593.aspx)适用于WinRT平台。例如,ContrastFilter类可能非常适合您。以下是使用方法:
using (var filterEffect = new FilterEffect(source))
{
// Initialize the filter and add the filter to the FilterEffect collection
var filter = new ContrastFilter(0.5);
filterEffect.Filters = new IFilter[] { filter };
// Create a target where the filtered image will be rendered to
var target = new WriteableBitmap(width, height);
// Create a new renderer which outputs WriteableBitmaps
using (var renderer = new WriteableBitmapRenderer(filterEffect, target))
{
// Render the image with the filter(s)
await renderer.RenderAsync();
// Set the output image to Image control as a source
ImageControl.Source = target;
}
await SaveEffectAsync(filterEffect, "ContrastFilter.jpg", outputImageSize);
}
在有人说这是从sdk文档中复制/粘贴之前,我已经将该示例写入了原始文档:(