Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
10-16-2011 12:10 AM - edited 10-16-2011 12:11 AM
when creating Bitmap from svg file I see that gradient colors are missed. Please find below code snippet:
SVGImage svgImage = SVGImage.createImage(inputStream, null); svgImage.setViewportWidth(image.width); svgImage.setViewportHeight(image.height); SVGSVGElement svgElement = (SVGSVGElement)svgImage.getDocument().getDocumentE
lement(); svgElement.setFloatTrait("width", svgImage.getViewportWidth()); svgElement.setFloatTrait("height", svgImage.getViewportHeight()); Bitmap bitmap = new Bitmap(image.width, image.height); bitmap.setARGB(new int[image.width * image.height], 0, image.width, 0, 0, image.width,image.height); Graphics graphics = Graphics.create(bitmap); ScalableGraphics scalableGraphics = ScalableGraphics.createInstance(); scalableGraphics.bindTarget(graphics); scalableGraphics.setRenderingQuality(ScalableGraph ics.RENDERING_QUALITY_HIGH); scalableGraphics.render(padding.left, padding.top, svgImage); scalableGraphics.releaseTarget(); // now bitmap is ready.
any thoughts would be very appreciated!
10-16-2011 03:26 PM
10-16-2011 04:31 PM - edited 10-16-2011 04:32 PM
The SVG rendered directly may be handled differently than the Bitmap. I know in the past we've had issues with gradients on Bitmaps not being smooth (they appeared banded/blocky). How great is the color different between the gradient edges? If the colors are not that different, try using something like black to white or red to green, and see what it does.
10-16-2011 05:35 PM
10-16-2011 05:45 PM
The devices support (or used to only support) a specific color space. At the time we were using transparent PNG images with the gradient when we saw the issue. I think we converted all the images to the required color space and it mostly fixed the issue... but I don't recall it ever being perfect. Gradients on BlackBerry has always been a sore subject.
10-17-2011 12:00 AM