java怎么将标签弄成圆形,如何在Java中制作圆形图像标签?

How to make Circle image Label in Java?

I wanna make circle image Label But I can't do this.. Hey guys Help me..T.T

I tried make circle panel for add image icon but that didn't work.

help me please...

解决方案

I think you should change your tack, instead of trying to modify the output of a component, instead, modify the input...

8sMMB.png

So all this does, is apply a circular (alpha based) mask to another image

BufferedImage master = ImageIO.read(new File("/Volumes/Disk02/Dropbox/MegaTokyo/thumnails/megatokyo_omnibus_1_3_cover_by_fredrin-d4oupef.jpg"));

int diameter = Math.min(master.getWidth(), master.getHeight());

BufferedImage mask = new BufferedImage(master.getWidth(), master.getHeight(), BufferedImage.TYPE_INT_ARGB);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值