Problem
Alpha channel is black opaque when using
toImage()
when it should be transparent. Same behavior the view is set with
backgroundColor: 'transparent'
.
The background works as expected on iOS, ie it is transparent.
Test case
See attached screenshot for results.
Ti.UI.backgroundColor = 'yellow';
var win = Ti.UI.createWindow();
// the same issue exists when using an imageView here rather than a View
var view = Ti.UI.createView({
backgroundColor:'transparent',
backgroundImage: 'alpha.png',
top: 50,
width: 300,
height: 300
});
win.add(view);
var blob = view.toImage();
var rendered = Ti.UI.createImageView({
backgroundColor:'transparent',
image: blob,
top: 200,
width: 300,
height: 300
});
win.add(rendered);
win.open();
Discussions
Q&A: [android - toimage no transparency](
http://developer.appcelerator.com/question/127966/android---toimage-no-transparency)
Brice So that I may escalate this ticket, would you please provide the missing info to the environment field (in accordance with [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist)), and attach the
alpha.png
image? Many thanksThanks Paul, the alpha.png image is attached. The Android SDK version is 2.3.4.
Brice, I need to test this before moving it across. However, some suggestions: * have you tried this with 1.8.0.1? Is there any reason why you are not using this version? * with the
view
variable, rather than using a Titanium View object, try an imageView and with animage
property rather thanbackgroundImage
Let me know how you get on with this. CheersAny updates? any time frame as to when this will be resolved?
Can someone put a priority on this bug please; it has been opened up last november and still has not been fixed. I really need this to be fixed soon
PR opened: https://github.com/appcelerator/titanium_mobile/pull/2780
Verified on: SDK:2.2.0.v20120827143312 Studio:2.1.2.201208201549 Devices: Android Emulator,LG-P970(v 2.2.2) toImage method returns transparent backgroundImage as fully transparent.
Reopening to update labels