alpha

Render to texture problem with alpha

拟墨画扇 提交于 2019-12-22 08:55:02
问题 When I render to texture, and then draw the same image, it seems to make everything darker. To get this image: http://img24.imageshack.us/img24/8061/87993367.png I'm rendering the upper-left square with color (1, 1, 1, .8) to a texture, then rendering that texture, plus the middle square (same color) to another texture, then finally that texture plus the lower-right square (same color) to the screen. As you can see, each time I render to texture, everything gets a little darker. My render-to

Telling ggplot NOT to scale alpha

一世执手 提交于 2019-12-22 07:09:08
问题 I would like to use the explicit values for the alpha level. head(D) x y group alpha 1 1 18 A 0.40 <~~~~ 2 2 18 A 0.44 3 3 18 A 0.47 4 1 18 A 0.51 5 2 21 B 0.55 6 3 21 B 0.58 ... However, ggplot is scaling the alpha levels. I can override this using scale_alpha_continuous(range=range(D$alpha)) , but this becomes a neusance when creating the graph programatically. Is there a direct way to tell ggplot NOT to scale alpha? (instead of telling it what range to scale to) Reproducible Exmple library

Change int color opacity in java/android

不打扰是莪最后的温柔 提交于 2019-12-22 04:12:37
问题 I am trying to change the opacity of a color that I get of my theme with the next code: TypedValue typedValueDrawerSelected = new TypedValue(); getTheme().resolveAttribute(R.attr.colorPrimary, typedValueDrawerSelected, true); int colorDrawerItemSelected = typedValueDrawerSelected.data; I want that the colorDrawerItemSelected keeps the same color, buth its alpha should be 25%. I found some solutions getting the rgb color from the imageView, but I havent imageView. Thank you for your time. 回答1:

How to set bitmap to ARGB_8888 in android?

☆樱花仙子☆ 提交于 2019-12-22 00:16:29
问题 In my android project, I load a bitmap from a image in the phone. I then do various image manipulations to it like cropping, resizing, editing pixel values. But the problem is the format of the bitmap is not ARGB_8888, so its not really storing the alpha values. Or rather its always keeping them at 255. How can I load the bitmap in ARGB_8888 format? This is my code to load and resize. How can I specify the format in any of these? Thanks private static Bitmap resize(Bitmap img, int newW, int

HTML5 Canvas Make Black Transparent

非 Y 不嫁゛ 提交于 2019-12-21 20:24:11
问题 I have a large amount of images with a black background, here is one for example: Is it possible through Javascript to have to ignore the black (#000000) and have it draw on canvas? to appear like this? Basically trying to take the black pixels and make it an alpha channel. 回答1: So you'll need to run through all the pixels and change the alpha value of all the black pixels. https://jsfiddle.net/0kuph15a/2/ This code creates a buffer (empty canvas) to draw the original image to. Once thats

OpenGL ES 2.0 PNG alpha channel

梦想与她 提交于 2019-12-21 12:06:09
问题 I am just learning to work with OpenGL ES 2.0 for Android. I have been trying to simply display a texture on the middle of the screen, which was easy enough, but I cannot seem to get the PNG alpha to work properly. The image will either show with a black background, or the entire image will be blended into the background color slightly, depending on the settings I use. The actual tutorials I have followed to get to this point never worked with transparency, so I have tried to work in code I

JS-运动基础——案例应用:淡入淡出效果

南楼画角 提交于 2019-12-21 12:00:59
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>淡入淡出</title> <style type="text/css"> .div { width: 100px; height: 100px; background-color: red; margin-top: 50px; position: absolute; left: 100px; top: 0; cursor: pointer; opacity: 0.3; filter: alpha(opacity:30); } </style> <script type="text/javascript"> window.onload = function(){ var oDiv = document.getElementById('div'); oDiv.onmouseover = function(){ start(100); }; oDiv.onmouseout = function(){ start(30); } } var alpha = 30;//关键点 var timer =null; function start(iTarget){ var oDiv = document.getElementById('div'); clearInterval

Error “Transparency encoding with auto_alt_ref does not work” when converting a .mov with Alpha to .webm with alpha with ffmpeg

流过昼夜 提交于 2019-12-21 07:24:43
问题 I am trying to convert a .mov file with alpha transparency into a .webm file and have been following this thread for help: Convert mov with Alpha to VP9 Webm with Alpha Using ffmpeg The command line I have been using is ffmpeg -r 24/1 -i Desktop/Skel_Walk_1.mov -c:v libvpx -pix_fmt yuva420p Desktop/Skel_Walk_1.webm However when I go to run the command it comes up with 2 errors Transparency encoding with auto_alt_ref does not work and Error initializing output stream 0:0 -- Error while opening

How to correctly set alpha of UIView? [iOS]

穿精又带淫゛_ 提交于 2019-12-21 04:29:23
问题 I have UIView with lots of subviews (UILabel, UITextView, etc.). If a set alpha 0.6 to main view all the subviews takes this alpha. How to set alpha separately of main view? 回答1: [view setBackgroundColor:[[UIColor clearColor] colorWithAlphaComponent:0.5]]; //try this.. dont try to set alpha of UIView and also your subviews will not affect 回答2: myView.layer.shouldRasterize = YES This will make it use group opacity and everything should composite as you'd expect. 来源: https://stackoverflow.com

UISlider ignores alpha when set to 0.5

人走茶凉 提交于 2019-12-21 03:57:38
问题 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