alpha

UISlider ignores alpha when set to 0.5

一曲冷凌霜 提交于 2019-12-03 12:48:31
Why does the UISlider view ignore the alpha view when set to 0.5? Code: for (int i = 0; i < 3; i++) { UISlider *slider = [[[UISlider alloc] initWithFrame:CGRectMake(0, i * 30, 200, 30)] autorelease]; slider.alpha = 0.4 + (CGFloat)i / 10.0f; [window addSubview:slider]; } Result: The sliders have alpha values 0.4, 0.5 and 0.6. And as you can see the middle one with 0.5 is completely opaque. It seams to only occur with alpha 0.5. Have tested other UI controllers and they work as expected with alpha is set to 0.5. Reproduced with iOS 4.2 on real device and with iOS 3.2 and 4.2 in simulator. BTW if

UIView alpha vs. UIColor alpha

我只是一个虾纸丫 提交于 2019-12-03 11:14:42
I would like to know the difference between: Assigning my UIView a color with <1 alpha vs Assigning it a non-transparent color but giving the UIView a <1 alpha value. On the screenshot I have made two UIViews with two black (alpha = 1.0) UILabels on top of each: Assume a macro _RGB is defined before: #define _RGB(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] and then here is the code:: [_view1 setBackgroundColor:_RGB(255, 0, 0, 1)]; [_view1 setAlpha:0.5]; [_view2 setBackgroundColor:_RGB(255, 0, 0, 0.5)]; [_view2 setAlpha:1]; [_view3 setBackgroundColor:_RGB(255, 0,

Why do browsers render rgba differently on OSX?

扶醉桌前 提交于 2019-12-03 08:25:58
I was trying to code up some color manipulation code and was stuck for a long time with alpha, then I (2 hours later) realized browsers render rgba differently. I created this test: http://jsbin.com/adekez/2/ add /edit to look at the code Here are the results in 4 browsers in OSX Lion: http://imgur.com/g2iqu That is an element with a background of rgba(0,0,0,0.5) on top of white. My hex calculator says: FF÷2 = 7F.8 which means Safari at #808080 is correct Firefox at #7F7F7F is off by 1 Opera at #7E7E7E is off by 2 Chrome at #929292 is way off What's going here, is this a bug in Chrome or do I

Transparent png resizing with Python Image Library and the halo effect

怎甘沉沦 提交于 2019-12-03 08:08:04
There are a couple similar questions on SO, but none of them really helped. Basically I am trying to resize a simple png image, as seen here: http://media.spiralknights.com/wiki-images/3/3e/Equipment-Proto_Sword_icon.png (from the mmo Spiral Knights, copyright Three Rings Entertainment) I had originally implemented a utility which uses these images in php, and the resizing utility there worked perfectly well. I used the method described on the imagecopyresampled page in PHP's documentation. Honestly I can't even get it to resize better in Photoshop, but the results are almost disastrous in

How to convert grayscale bitmap into alpha mask?

六眼飞鱼酱① 提交于 2019-12-03 08:04:17
问题 I have a grayscale JPG picture, and I'd like to load it into Bitmap of format Bitmap.Config.ALPHA_8 . Is that possible, how can I do that? It's straightforward to load alpha channel from a PNG (which can have empty R,G,B channels), but I'd like to use JPG for compression. This is a followup question to How to combine two opaque bitmaps into one with alpha channel? 回答1: ColorMatrix to rescue! Quoting Android docs, ColorMatrix: 5x4 matrix for transforming the color+alpha components of a Bitmap.

Adjust Transparency (alpha) of stat_smooth lines, not just transparency of Confidence Interval

霸气de小男生 提交于 2019-12-03 05:30:23
问题 Using ggplot2's stat_smooth(), I'm curious how one might adjust the transparency of the generated regression line. Using geom_points() or geom_line(), one normally sets a value for 'alpha', indicating the percent transparency. However, with stat_smooth(), alpha sets the transparency of the confidence interval (in my sample below, turned off - se=FALSE). I cannot seem to find a way to make the regression line(s) a lower transparency than 1. Your advice would be wonderful. Sample Code library

Is the opacity and alpha the same thing for UIView [duplicate]

心不动则不痛 提交于 2019-12-03 04:43:34
This question already has answers here : UIView: opaque vs. alpha vs. opacity (2 answers) I want to use animation to change UIView's color to make it fade, however, somehow i can't access and set opacity, but i can set alpha. I wonder if alpha and opacity are the same? Search on the web and I didnt find a good answer. Thanks a lot for your help! alex Actually "opacity" means "value of alpha-channel" of your UIView . When a view is fully opaque this means its alpha = 1 , when a view is fully transparent (non-opaque) its alpha = 0 . As about properties of CALayer and UIView in Cocoa, yes, they

FFMPEG - Merging Videos with Transparency

百般思念 提交于 2019-12-03 03:44:07
I am trying to merge two videos together, both have transparency, using the command ffmpeg.exe -i person2.mov -vf "[in] scale=iw/2:ih/2,fade=out:300:30:alpha=1, pad=2*iw:ih [left]; movie=person2.mov, scale=iw/2:ih/2,fade=out:300:30:alpha=1 [right]; [left][right] overlay=main_w/3:0,fade=out:300:30:alpha=1 [out]" -b:v 768k Output_people.mov By doing that I get the following output: http://i263.photobucket.com/albums/ii122/Fernando461/Untitled.png As you can see, it was possible to get the two videos to be on top of each other. But then, when I try to merge this video (Output_people.mov) with

Video with alpha channel in Processing

…衆ロ難τιáo~ 提交于 2019-12-03 01:12:24
问题 I was wondering if anyone can be amazing and help me with something I'm working on in Processing . I need to play a video file with transparencies over a live feed so that the video isn't simply a rectangle. Here is the section of the code that I think I need to add something to or change. I'm extremely new to all of this and I'm extremely grateful to anyone that can help. 回答1: If you're video has an alpha channel, that's great, otherwise, you should be able to blend() the other content. Here