alpha

How to add transparency with a shader in SceneKit?

被刻印的时光 ゝ 提交于 2019-12-04 04:27:36
问题 I would like to have a transparency effect from an image, for now I just test with a torus, but the shader does not seem to work with alpha. From what I understood from this thread (Using Blending Functions in Scenekit) and this wiki link about transparency : (http://en.wikibooks.org/wiki/GLSL_Programming/GLUT/Transparency), GLBlendFunc is replaced by pragma transparency in SceneKit. Would you know what is wrong with this code? I created a new project with SceneKit, and I changed the ship

Display PNG with alpha channel in C#

女生的网名这么多〃 提交于 2019-12-04 03:52:25
Is there a way to properly display an image with alpha channel (let's say PNG) in C# application? Thank you for any suggestions. UPDATE: OK, my question was a bit unprecise. I'd like to acquire real transparency of alpha channel - not filling with the parent's background color. In the image below we can see that the transparency is supported, but the part of the button that lies below the image is not visible. Is it possible to have a real transparency of the alpha channel of an image? Kristoffer Schroeder If that is winforms then no. "transparency" in winforms is not real transparency. What

OpenGL ES 2.0 PNG alpha channel

大城市里の小女人 提交于 2019-12-04 03:26:20
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 have found by searching around, and likely have just missed one important step. I have searched quite a

第四周作业——统计/etc/init.d/functions文件中每个单词的出现次数,并排序(用grep和sed两种方法分别实现)

这一生的挚爱 提交于 2019-12-03 22:43:09
统计/etc/init.d/functions文件中每个单词的出现次数,并排序(用grep和sed两种方法分别实现) 方法一:grep实现 grep -o "\<[[:alpha:]]\+\>" /etc/init.d/functions |sort |uniq -c grep -o '[[:alpha:]]\+' /etc/init.d/functions | sort |uniq -c [root@centos7 data]# grep -o "\<[[:alpha:]]\+\>" /etc/init.d/functions |sort |uniq -c 21 a 5 A 1 aA 1 abnormally 5 action 1 active 1 ActiveState 1 adjust 1 alive 2 all 1 already 2 and 1 And 3 any 1 anywhere 1 Apply 1 are 1 arg 2 at 1 avoid 7 awk 8 b 1 backup 2 bak 29 base 2 basename 2 bash 7 be 6 BEGIN 1 bg 13 bin 11 binary 1 bit 2 booleans 1 boot 21 BOOTUP 2 break 3 but 1 by 6 c 1 caller 3 can 8

How to open PNG with CImg library without losing alpha channel?

那年仲夏 提交于 2019-12-03 21:50:31
When I open png file: CImg<unsigned char> image("image.png"); ...I expect to get 4 channel (RGBA) image. But I always get 3 channel (RGB) image instead (even if the image is semitransparent): image.spectrum() returns 3 instead of 4. In my application, I always need to get 4 channels when I open PNG file. CImg looks like popular library with many useful features (some of which may be useful in the future in my image processing application), so I find it hard to believe that it is impossible to open PNG file with alpha channel without losing it. Any suggestions? If CImg is not very good tool for

Alpha Blending 2 RGBA colors in C [duplicate]

主宰稳场 提交于 2019-12-03 17:45:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to do alpha blend fast? What is the fastest way to alpha blend 2 RGBA (Integer) colors? As a note, the target color where to blend is always opaque, only the second color can have different levels of transparency. I am trying to find the fastest way in C, taking into account that the final resulting color from the blend must end up with no transparency, fully opaque (alpha = 0xff) 回答1: int blend(unsigned

How can I create alpha blended icon/cursor (indirect) from the TBitmap instance of 32 bpp w/o making an temporary DIB section?

别等时光非礼了梦想. 提交于 2019-12-03 15:23:44
According to MS KB entry , there is a quirk in CreateIconIndirect which recognizes HBITMAP s been created with BITMAPV5HEADER passed to CreateDIBSection (and BGRA channel layout). However, TBitmap instances with (PixelFormat = pf32bit) and (AlphaFormat = afDefined) (behaving as alpha blended for the other purposes) when referred by its Handle s are not being recognized as valid alpha blended bitmaps for creation of icons or cursors. Currently, I have to create a full copy of TBitmap using described API calls ( see ) to make CreateIconIndirect accept a bitmap handle as alpha blended. How do I

Python PIL 0.5 opacity, transparency, alpha

时间秒杀一切 提交于 2019-12-03 15:04:53
Is there any way to make an image half transparent? the pseudo code is something like this: from PIL import Image image = Image.open('image.png') image = alpha(image, 0.5) I googled it for a couple of hours but I can't find anything useful. I realize this question is really old, but with the current version of Pillow (v4.2.1), there is a function called putalpha . It seems to work fine for me. I don't know if will work for every situation where you need to change the alpha, but it does work. It sets the alpha value for every pixel in the image. It seems, though that you can use a mask: http:/

How to correctly set alpha of UIView? [iOS]

混江龙づ霸主 提交于 2019-12-03 13:57:38
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? [view setBackgroundColor:[[UIColor clearColor] colorWithAlphaComponent:0.5]]; //try this.. dont try to set alpha of UIView and also your subviews will not affect myView.layer.shouldRasterize = YES This will make it use group opacity and everything should composite as you'd expect. 来源: https://stackoverflow.com/questions/17079160/how-to-correctly-set-alpha-of-uiview-ios

FFMPEG - Merging Videos with Transparency

Deadly 提交于 2019-12-03 13:36:09
问题 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