WPF中的双缓冲? [英] Double buffering in WPF?

查看:169
本文介绍了WPF中的双缓冲?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在WPF中开发图形控件.我以前使用GDI和C#开发了它. 我在以前的控件中使用了双缓冲,以避免某些与重绘图形控件有关的问题. 现在,当我在WPF中开发了Graph Control时,我遇到了一个问题,当我将Graph Control用作Windows窗体中的用户控件时,将其锚定到窗体上,并且在运行并调整其大小时,我可以清楚地看到两个黑色在图形控件的右下角和右下角的水平线和垂直线...我想在调整图形大小时,要占据调整后的面积,图形控件会花费时间,而与此同时,未被图形填充的区域控件显示为黑色...

I'm developing a graph control in WPF. I have previously developed it using GDI and C#. i've used double buffering in previous control to avoid some issues related to redrawing of the graph control. Now when i've developed the Graph Control in WPF i have a problem, when i use my Graph Control as a user control in a windows form,anchoring it to the form,and when running it and resizing it i can clearly see two black lines horizontal one and a vertical one in the right and bottom corners of the graph control... i think when i am resizing the graph, to occupy the resized area graph control is taking time and in the mean time the area not filled by the control is seen black...

在WPF中是否有解决此问题的方法?像双缓冲一样?

is there any solution to this problem in WPF? like double buffering?

我如何避免这个问题?

致谢, 兰加纳.

推荐答案

WPF使用DirectX进行渲染,因此您不需要doubleBuffer.也许问题出在您的布局代码中.

WPF uses DirectX for rendering, so you don't need to doubleBuffer. Perhaps the problem is in your layout code.

这篇关于WPF中的双缓冲?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆