如何在Asp.net中舍入图像 [英] How to Round the Images in Asp.net

查看:95
本文介绍了如何在Asp.net中舍入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,

我是编程新手,我在asp.net,C#上做了很少的项目,我对编程很少知识。



所以我的要求是我有宽度和高度为300px的图像。现在我想把它变成圆角。并显示在我的网页上。



请帮助。



谢谢

解决方案

学习使用 google [ ^ ]是您可以拥有的最重要的技能。


这是一个非常简单的方法。使用PNG格式。它支持透明度。使用一些合适的图像编辑器,绘制一些圆形区域(选择,不是图像的一部分),将其反转以获得圆形集的选定补充,并使用橡皮擦工具擦除图像的多余部分,使其达到100%透明度。将图像保存为PNG,并支持透明度并在页面上使用。



即使背景不均匀,您的图像也会看起来完美圆润。 />


(对于编辑器,我的第一选择是开源GIMP:

http://en.wikipedia.org/wiki/GIMP [ ^ ],

http://www.gimp.org/ [ ^ ]。)



祝你好运,



-SA


你可以尝试两件事

1.在带有圆角的photoshop中编辑图像,将其保存为.png或.gif格式并使用它。

2.使用CSS3属性

 border-radius:25px; 



参考: http://www.w3schools.com/css3/css 3_borders.asp [ ^ ]


Hello Friends,
am new to programming and i did little projects on asp.net , C# and I have little knowledge in programmming.

So my requirement is I have Images with width and height 300px. and now i want to make it rounded corners. and display in my webpage.

Please help.

Thanks

解决方案

Learning to use google[^] is the most important skill you can have.


One really simple approach is this. Use PNG format. It supports transparency. Using some suitable image editor, draw some circular region (the selection, which is not part of the image), invert it to obtain selected complement of the round set, and erase excess parts of image with an eraser tool to 100% transparency. Save the image as PNG with transparency support and use it on your page.

Even if the background is non-uniform, your image will looks as perfectly rounded.

(For the editor, my first choice would be open-source GIMP:
http://en.wikipedia.org/wiki/GIMP[^],
http://www.gimp.org/[^].)

Good luck,

—SA


you can try two things
1. Edit the image in photoshop with rounded corner save it into .png or .gif format and use it.
2. Use CSS3 Property

border-radius:25px;


Ref: http://www.w3schools.com/css3/css3_borders.asp[^]


这篇关于如何在Asp.net中舍入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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