使用区域剪辑的GDI +问题。 [英] GDI+ problem with clipping using regions.

查看:74
本文介绍了使用区域剪辑的GDI +问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我有代码,应该使用区域进行绘图剪裁。关于设置区域代码非常简单,典型地从示例中获取。问题是在尝试绘制剪裁的图形时,例如路径。当使用简单的语法时,例如:

I've got code, which should do drawing clipping using regions. Regarding setting region code is very simple and typical taken from examples. Problem is when trying to draw clipped graphics, e.g. paths. When used simple syntax, like:

graphics.DrawPath(pen, path);

一切正常,我的绘图应该剪裁。但是尝试使用更复杂的方法,比如GraphicsPathIterator,那么绘图是不可见的(完全剪裁)?例如:

everything works, my drawing is clipped as should be. But trying to use more complicated method, like GraphicsPathIterator, then drawing is not visible, (is clipped completely)? e.g:

Gdiplus::GraphicsPath path;

pathIterator.Rewind();

while(0 != pathIterator.NextMarker(&path)) {
    graphics.DrawPath(pen, &path);


当没有使用路径迭代器修剪代码时,绘制正常。

When not clipped code using path iterators draws fine.

推荐答案

你好,

Hi,

感谢您在此处发帖。

>>我有代码,应该使用区域进行绘图裁剪。关于设置区域代码非常简单,典型地从示例中获取。问题是在尝试绘制剪裁的图形时,例如路径。使用简单的语法时,例如...

您是否想要使用GraphicsPathIterator绘制多个剪裁的图形?  

Did you mean that you want draw multiple clipped graphics by using GraphicsPathIterator?  

例如,像这样:

或者在使用Graphics :: SetClip方法将此Graphics对象的剪切区域更新到某个区域后,您无法使用路径迭代器绘制?

Or you can't used path iterator draws after you used the Graphics::SetClip method updates the clipping region of this Graphics object to a region?

如果可能的话,如果您能为我们提供样本以重现您的问题,我将不胜感激。 

If possible, I would appreciate it if you could provide a sample for us to reproduce your issue. 

祝福,祝贺

Best Wishes,

Jack Zhang

Jack Zhang


这篇关于使用区域剪辑的GDI +问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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