• 周五. 12月 2nd, 2022

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

URGENT: transparency in an image – Java From 5gw.org

[db:作者]

4月 10, 2022

xmlns=”http://www.w3.org/1999/xhtml” dir=”ltr” lang=”en”>
URGENT: transparency in an image – Java
/**
* Bytes CSS
* Style: ‘bytes.answers’; Style ID: 18
*/
@import url(“/clientscript/vbulletin_css/style-12635a82-00018.css”);

 
 
470,371 Members | 1,560 Online

URGENT: transparency in an image

I yant to put transparency in an image without transparency and
without having to create a new image. This mean that I wan to read an
image from the disk and add some alpha in it.

for now, I have

private void createStdImage()
{
RenderedImage rImage = JAI.create("fileload", getName());
if (rImage instanceof PlanarImage)
{
PlanarImage pImage = (PlanarImage)rImage;
BufferedImage image = pImage.getAsBufferedImage();
setImageTransparent(image);
}
}
public void setImageTransparent(BufferedImage image)
{
for(int x = 0; x < image.getWidth(); x++)
{
for(int y = 0; y < image.getWidth(); y++)
{
int rgba = image.getRGB(x,y);
rgba = ((rgba & 0x00ffffff) | (255 << 24));
image.setRGB(x,y,rgba);
}
}
}

But this do not work!

Any idea?

Jul 17 ’05
#1

0 1513


(adsbygoogle = window.adsbygoogle || []).push({});

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics


4 posts

views

Thread by Matthias Czapla |
last post: by


2 posts

views

Thread by Robin Becker |
last post: by


3 posts

views

Thread by Mr. x |
last post: by


20 posts

views

Thread by Nathan Sokalski |
last post: by


6 posts

views

Thread by tommaso.gastaldi |
last post: by


4 posts

views

Thread by Ibrahim. |
last post: by


3 posts

views

Thread by Martijn Mulder |
last post: by


1 post

views

Thread by perto1 |
last post: by


reply

views

Thread by cosinus |
last post: by

By using this site, you agree to our Privacy Policy and Terms of Use.


(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-90111-7’, ‘bytes.com’);
ga(‘send’, ‘pageview’);

loadBytesTracking()

//0){location.replace(‘https://bytes.com/showthread.php?p=’+cpostno);};} }

if(typeof window.orig_onload == “function”) window.orig_onload();
}

//]]>

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注