如何在窗口上渲染图像使其适合圆形或椭圆形? [英] How does one render an image on a window making it fit into a circle or an ellipse?

查看:98
本文介绍了如何在窗口上渲染图像使其适合圆形或椭圆形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定基于矩形或正方形的图像,如何在窗口上渲染它以使图像适合我自己选择的圆形或椭圆形?



我尝试了什么:



我已经使用google搜索解决方案但无法找到任何解决方案。

Given a rectangular or square based image, how do I render it on a window so that the image fit into a circle or ellipse of my own choice?

What I have tried:

I have googled fora solution but was unable to find any.

推荐答案

如果您只想绘制部分图像,则必须仅绘制这些部分。通过一些数学,您可以检测坐标及其像素是否与我们的绘图区域相似。



另一种方式是与地区合作。深入研究地区创建者一文。



我的建议是坚持使用区域,因为微软有一些功能
If you want to draw only parts of the image you must draw only these parts. With somemath you can detect whether a coordinate and its pixel belomg to our drawing region.

Another way is to work with regions. Take a dive into the article A Region Creator.

My tip is to stick with regions, because Microsoft has some functionality built into Windows.


这篇关于如何在窗口上渲染图像使其适合圆形或椭圆形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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