[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-2616) <s:transformImageSize> fills transparent areas with white background

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Jul 29 18:04:53 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBSEAM-2616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pete Muir updated JBSEAM-2616:
------------------------------

    Fix Version/s: The future
                       (was: 2.1.0.GA)


> <s:transformImageSize> fills transparent areas with white background
> --------------------------------------------------------------------
>
>                 Key: JBSEAM-2616
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-2616
>             Project: Seam
>          Issue Type: Bug
>          Components: JSF Controls
>    Affects Versions: 2.0.0.GA
>         Environment: Windows, Jboss 4.2.1, Facelets
>            Reporter: Manfred Griesser
>            Assignee: Pete Muir
>            Priority: Minor
>             Fix For: The future
>
>
> if a png-image containing transparent areas is scaled, the transparent areas get filled with white color.
> I created my own transformImageSize-component which works properly. 
> Its applyTransformation method looks like that:
> <code>
>   public void applyTransform(Image image) throws IOException {
>     ...........
>     BufferedImage in = image.getBufferedImage();
>     GraphicsConfiguration gc = in.createGraphics().getDeviceConfiguration();
>     BufferedImage out = gc.createCompatibleImage(scaledWidth, scaledHeight,
>         Transparency.BITMASK);
>     Graphics2D g2d = out.createGraphics();
>     g2d.setComposite(AlphaComposite.Src);
>     g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
>         RenderingHints.VALUE_INTERPOLATION_BICUBIC);
>     g2d.drawImage(in, 0, 0, scaledWidth, scaledHeight, null);
>     g2d.dispose();
>     image.setBufferedImage(out);
>   }
> </code>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list