[AC-3205] iOS : Masking an Image with Color
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | n/a |
| Status | Resolved |
| Resolution | Done |
| Resolution Date | 2015-09-30T01:05:31.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | ios |
| Reporter | Joseph Sachs |
| Assignee | Shak Hossain |
| Created | 2015-04-19T12:43:22.000+0000 |
| Updated | 2016-03-08T07:57:36.000+0000 |
Description
Ability to *mask an Image with an array of Colors*, as seen here (attached an image as well to see the effect):
https://developer.apple.com/library/ios/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/dq_images.html#//apple_ref/doc/uid/TP30001066-CH212-CJBHCADE
CGImageRef myColorMaskedImage;
const CGFloat myMaskingColors[6] = {124, 255, 68, 222, 0, 165};
myColorMaskedImage = CGImageCreateWithMaskingColors (image,
myMaskingColors);
CGContextDrawImage (context, myContextRect, myColorMaskedImage);
The Current Titanium.UI.MaskedImage: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.MaskedImage does not allow to mask an image with a color.
Attachments
| File | Date | Size |
|---|---|---|
| chroma_key.gif | 2015-04-19T12:43:22.000+0000 | 10916 |
| ImageMasking.zip | 2015-04-19T13:11:25.000+0000 | 10467987 |
Sample Code attached. Uses ImageMask with modes.
Thanks Joseph Sachs , We have tested this issue with TiSDK 3.5.2 GA and 4.0.0 Beta2 on iOS. Its a New Feature and working fine . . *modes*
*Log*var modes = [ Ti.UI.iOS.BLEND_MODE_CLEAR, Ti.UI.iOS.BLEND_MODE_COLOR, Ti.UI.iOS.BLEND_MODE_COLOR_BURN, Ti.UI.iOS.BLEND_MODE_COLOR_DODGE, Ti.UI.iOS.BLEND_MODE_COPY, Ti.UI.iOS.BLEND_MODE_DARKEN, Ti.UI.iOS.BLEND_MODE_DESTINATION_ATOP, Ti.UI.iOS.BLEND_MODE_DESTINATION_IN, Ti.UI.iOS.BLEND_MODE_DESTINATION_OUT, Ti.UI.iOS.BLEND_MODE_DESTINATION_OVER, Ti.UI.iOS.BLEND_MODE_DIFFERENCE, Ti.UI.iOS.BLEND_MODE_EXCLUSION, Ti.UI.iOS.BLEND_MODE_HARD_LIGHT, Ti.UI.iOS.BLEND_MODE_HUE, Ti.UI.iOS.BLEND_MODE_LIGHTEN, Ti.UI.iOS.BLEND_MODE_LUMINOSITY, // Grayscale Ti.UI.iOS.BLEND_MODE_MULTIPLY, Ti.UI.iOS.BLEND_MODE_NORMAL, Ti.UI.iOS.BLEND_MODE_OVERLAY, Ti.UI.iOS.BLEND_MODE_PLUS_DARKER, Ti.UI.iOS.BLEND_MODE_PLUS_LIGHTER, Ti.UI.iOS.BLEND_MODE_SATURATION, Ti.UI.iOS.BLEND_MODE_SCREEN, Ti.UI.iOS.BLEND_MODE_SOFT_LIGHT, Ti.UI.iOS.BLEND_MODE_SOURCE_ATOP, // Masks underneath Ti.UI.iOS.BLEND_MODE_SOURCE_IN, Ti.UI.iOS.BLEND_MODE_SOURCE_OUT, Ti.UI.iOS.BLEND_MODE_XOR ];