- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在Silverlight中用某种颜色覆盖WriteableBitmap。我有一个黑白基础图像,用于为新的合成图像创建较小的WriteableBitmap图像,并且我想在源图像切口的黑色或白色部分上使用某种颜色进行覆盖,然后再将其添加到复合图像。
我现在正在做的是:
var cutOut = new WriteableBitmap(8, 14);
/*
cut out the image here
*/
cutOut.Render(sourceImage, transform); // sourceImage is the base image
cutOutImage.Source = cutOut; // cutOutImage is an Image element in XAML
compositeImage.Render(cutOutImage, transform2); // compositeImage is the final WriteableBitmap that is shown on screen
最佳答案
只是一个快速的猜测,但是您在执行WriteableBitmap.Render(...)之后是否尝试过WriteableBitmap.Invalidate()?
除此之外,您可能想尝试将图像渲染到临时的WriteableBitmap,然后使用WriteableBitmap.Pixels将临时的图像复制到新的位图上。在该新位图上,您应该能够执行图像处理。
干杯,亚历克斯
关于.net - 用颜色覆盖WriteableBitmap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2408376/
我想弄清楚如何释放 WriteableBitmap 内存。 在下一段代码中,我用来自“BigImage”(3600 * 4800 px,仅用于测试)的大量数据填充 WriteableBitmap 的后
我可以像这样成功加载以下位图并将其显示在 View 上的图像控件中。 var bitmapImage = new BitmapImage {
我目前有一个这样的循环: foreach(var item in theList) { //create writeablebitmap from item.GetPicture() which re
我正在将分形作为一个私有(private)项目来练习(离开初学者水平^^)。我有一个包含图像的 Canvas ,该图像绑定(bind)到 WriteableBitmap: 我的 View 模
问题来了。我想从本地驱动器打开一个文件,然后将它变成一个 WritableBitmap 以便我可以编辑它。但问题是,我无法从 Uri 或类似的东西创建 WritableBitmap。我也知道如何将文件
我正在用 WPF (C#) 编写一个应用程序,它对位图集合执行长时间操作。为了让我的应用程序保持响应,我决定使用另一个线程来执行位图操作并在主 UI 线程的进度条上报告进度。我原以为 Backgrou
我有一个 WritableBitmap,它在单独的线程上更新,特别是响应事件。 myWritableBitmap.Lock(); CopyMemory(myWritableBitmap.BackBuf
我正在 WP7 芒果中编写应用程序,并尝试将从绑定(bind)加载的图像转换为 XAML 中的 WriteableBitmap,例如:
我正在使用下面的代码创建一个基于 UI 元素的动态磁贴。它在 WriteableBitmap 上呈现 uiElement,保存位图 + 返回文件名。此方法在 Windows Phone 后台任务代理中
有一个简单的MSDN example关于可写位图。 它展示了如何通过在按下鼠标并在 WPF 图像控件上移动时仅更新一个像素来使用光标绘制手绘线。 writeableBitmap.Lock();
我创建了一个 Gray16 格式的 WriteableBitmap。我想将此 WriteableBitmap 调整为我已知的尺寸,保留像素格式(Gray16)。 有人致力于调整 WriteableBi
我有一些 WriteableBitmap 对象。假设实际上位于 WriteableBitmap 对象上的图像是 600x400。 我想复制部分图像 - 一些矩形(例如 WriteableBitmap
有没有办法将 WriteableBitmap 转换为字节数组?如果有办法从中获取可写位图,我也将其分配给 System.Windows.Controls.Image 源。我试过这个但是在 FromHB
我正在使用 PhotoChooserTask 从图库中挑选图像,这是我的设置 private void ApplicationBarIconButton_Click(object sender, Ev
我有一个应用程序,其中使用 WriteableBitmap 进行对性能敏感的绘图。使用 CompositionTarget.Rendering 调用一个事件来实际更新 WriteableBitmap
我已经尝试了几个小时,但我无法解决这个问题。 我有一个 UserControl,它是 800x369,它只包含一条形成世界地图的路径。我将其放在横向页面上,然后将其呈现为 WriteableBitma
我正在修改 ColorBasic Kinect 示例,以便显示覆盖到视频流的图像。所以我所做的是加载一个图像具有透明背景(现在是一个 GIF,但它可能会改变),并写入显示的位图。 我得到的错误是我正在
目标是渲染 2 行以 ... 结尾的文本。我认为问题是高度不会按照我告诉它的大小呈现(参见 maxHeight=30,但 actualHeight 82)。 “canvas”变量是一个可写的位图。 我
我在连接到图像控件的 Windows Phone 8 应用程序中有一个 WriteableBitmap。我循环遍历图像的每一行并一次异步绘制一行像素,然后安排下一行进行绘制。但是,更改基础像素数据似乎
我正在开发一个用于将图像上传到网络服务器的 Windows Phone 应用程序。我正在从我的设备中选择所有图像到一个列表对象。我正在将所有位图图像一张一张地转换为 byte[]。 我的代码 publ
我是一名优秀的程序员,十分优秀!