alpha-transparency

turning a div into transparent to see through two containers

ぐ巨炮叔叔 提交于 2019-11-28 04:08:49
问题 I have following markup <body> <div class="holder"> <div class="circle"></div> </div> </body> and i have applied a fixed background to body element and white background applied to class holder body { background: url(image.png); background-attachment: fixed; } .holder { width: 500px; height: 500px; background: #fff; } .circle { width: 100px; height: 100px; border-radius: 50%; background: rgba(0, 0, 0, 0); } what i have tried to do is to make the circle transparent to see the body background.

How to set given channel of a cv::Mat to a given value efficiently without changing other channels?

房东的猫 提交于 2019-11-28 00:46:16
How to set given channel of a cv::Mat to a given value efficiently without changing other channels? For example, I want to set its fourth channel (alpha channel) value to 120 (i.e. half transparent), something like: cv::Mat mat; // with type CV_BGRA ... mat.getChannel(3) = Scalar(120); // <- this is what I want to do P.S.: My current solution is first split the mat into multiple channels and set the alpha channel, and then merge them back. P.S.2: I know that I can do this quickly if I also want to change other channels as well by: mat.setTo(Scalar(54, 154, 65, 120)); Update with generalized

How to create transparent activity in android?

情到浓时终转凉″ 提交于 2019-11-27 19:31:24
How to create transparent activity in android in that screen tap to dismiss button automatically dismiss the activity. please provide any solution. Rachita Nanda There are two ways to achieve this use the following theme for activity. android:theme="@android:style/Theme.Translucent" Set background of the activity as a trans parent png image or a transparent code eg. android:background="@drawable/transparent_bg" or android:background="#33BBFFFF" this is a semi transparent color Related Links How to make a background 20% transparent on Android Understanding colors on Android (six characters) To

How to create an h264 video with an alpha channel for use with HTML5 Canvas?

拥有回忆 提交于 2019-11-27 18:03:08
I've been interested in this demo: http://jakearchibald.com/scratch/alphavid/ I also saw this question on here: Can I have a video with transparent background using HTML5 video tag? But I can't seem to figure out: How do you create h264, ogg and webm video files with alpha channels? Phrogz If you open this video from your demo with QuickTime you will see a video with separate RGB and A regions: If you then look at the code for the demo, you will see that it is using one offscreen HTML5 Canvas to draw each video frame to, reading the alpha pixels from the second half of that canvas to set

Setting alpha on UIView sets the alpha on its subviews which should not happen

左心房为你撑大大i 提交于 2019-11-27 10:04:01
问题 According to the documentation for UIVIew @property(nonatomic) CGFloat alpha The value of this property is a floating-point number in the range 0.0 to 1.0, where 0.0 represents totally transparent and 1.0 represents totally opaque. This value affects only the current view and does not affect any of its embedded subviews. I have a container view configured as follows: self.myView.backgroundColor = [UIColor blackColor]; self.myView.alpha = 0.5; [self addSubview:self.myView]; And then add

JTextArea not selectable, but still showing a “ghost” cursor

旧巷老猫 提交于 2019-11-27 05:29:40
I put a JTextArea in a JPanel. This JPanel has a picture on the background, and the JTextArea is translucent (translucid red) to show the background through. I don't want the user to be able to edit or select the text, I want it to act just as a JLabel (but with multiple lines and easy to word wrap and adjust to screen resize). I tried all these options: text.setEditable(false); text.setFocusable(false); text.setEnabled(false); text.setHighlighter(null); but still some change of color happens as the user drags the mouse over the JTextArea. Anyone knows what is going on? You can't simply set

How to convert an image to an icon without losing transparency?

时光毁灭记忆、已成空白 提交于 2019-11-27 05:27:56
I have PNG images which I need to convert to an icon before displaying it. This is how I did it: public Icon ImageToIcon(Image imgTest) { Bitmap bitmap = new Bitmap(imgTest); Icon icoTest; IntPtr iPtr = bitmap.GetHicon(); icoTest = (Icon) Icon.FromHandle(iPtr).Clone(); return icoTest; } I lose transparency after doing this, alpha transparent images are not rendered as expected....can this be solved? No, there's a lot more to it. Icons have a pretty elaborate internal structure, optimized to work reasonably on 1980s hardware. An icon image has three bitmaps, one for the icon, a monochrome

Use native HBitmap in C# while preserving alpha channel/transparency

淺唱寂寞╮ 提交于 2019-11-27 03:39:19
问题 Let's say I get a HBITMAP object/handle from a native Windows function. I can convert it to a managed bitmap using Bitmap.FromHbitmap(nativeHBitmap) , but if the native image has transparency information (alpha channel), it is lost by this conversion. There are a few questions on Stack Overflow regarding this issue. Using information from the first answer of this question (How to draw ARGB bitmap using GDI+?), I wrote a piece of code that I've tried and it works. It basically gets the native

Replace transparency in PNG images with white background

可紊 提交于 2019-11-27 02:27:19
I've got some PNG images with transparency, and I need to create versions with the image layer composed onto a white background. I've tried various things with Image Magick "convert" operations, but either nothing happens at all or I get an error. I don't want to go to an intermediate JPG form because I don't want the artifacts. Of course it's easy to do this in Gimp or Photoshop or whatever, but I'd really rather script it from the command line because there are many of these things. An example of a non-working Image Magick command is: convert img1.png -background white -flatten img1-white

Alpha-gradient on Android

你说的曾经没有我的故事 提交于 2019-11-27 01:35:52
问题 I need to create an alpha-gradient on the edge of the ImageView. Preferably using only XML. Image for example 回答1: Here the solution the image look like below picture code for that : Prepare shape drawable res/drawable/gradient_shape.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#00FFFFFF" android:endColor="#FFFFFFFF" android:type="linear" /> </shape> Define layout: activity_main.xml: <ImageView