等效于WPF的DrawImage? [英] DrawImage equivalent in WPF ?

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

问题描述

我试图找出一种方法来像WinImages中的DrawImage一样做事.我希望能够在窗体表面或图像控件上绘制多个图像,这些图像彼此重叠,并且同时只能绘制源图像的一部分.我该怎么做 ?我可以使用DrawImage的替代项之一,而仅将源图像的一部分绘制在另一图像上,而无需实际擦除控件的背景.

举一个例子,假设您有两个图像Image1和Image2.您在屏幕上绘制Image1,现在,您仅将Image2的一部分(例如,从Image2的中心开始的一小块矩形部分)绘制到Image1上,该图像将仅覆盖Image1的一部分,即实际上将已经绘制的Image1擦除. br/>
您将如何处理-
1.您要不透明地绘制Image2和Image1.
2.您要不透明地绘制Image1并以部分透明度绘制Image2覆盖Image1的一部分,以便Image1通过Image2展示?

任何帮助将不胜感激.

谢谢.

I'm trying to figure out a way to do things the way DrawImage could do in WinForms. I want to be able to draw several images on the form surface or on an image control, with the images overlapping each other and at the same time being able to draw only a part of the source image. How do I do it ? I could use one of the overrides of DrawImage and draw only a portion of the source image over another image without actually erasing the background of the control.

To give an example, say you've two images Image1 and Image2. You draw Image1 on the screen and now, you draw only a part of the Image2 (say a small rectangular part from the centre of Image2) onto Image1 which, would cover only a part of Image1 i.e. wihtout actually erasing the already drawn Image1.

How would you go about it -
1. You want Image2 and Image1 both to be opaquely drawn.
2. You want to draw Image1 opaque and draw Image2 with partial transparency to cover a part of Image1 so that, Image1 shows thru' Image2 ?

Any help would be greatly appreciated.

Thanks.

推荐答案

有人吗?


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

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