alpha-transparency

Is there a way to set drawable's Alpha using XML?

左心房为你撑大大i 提交于 2019-11-28 19:33:53
问题 Easy like itself . I wanna make an alpha button , which would have a selected drawable this way: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Play/Pause --> <item android:state_selected="false" android:drawable="@drawable/item" /> <item android:state_selected="true" android:drawable="@drawable/item" /> </selector> I would wanna make something like this: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http:/

Transparent equivalent of given color

一曲冷凌霜 提交于 2019-11-28 19:33:37
问题 I've had this a few times, so here goes: I'm making some plots which hold curves with estimates of a parameter given a tuning parameter. Typically, I also have SDs for each estimated value, so I could show error bars around each of them. However, I don't like error bars, and would prefer some smoothed version of it. This is in itself no problem (ie I know how to do this). However, my plot contains several of these similar curves, each one in its own color. So I would like to add the 'smoothed

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

我怕爱的太早我们不能终老 提交于 2019-11-28 16:56:12
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 subviews to 'myView' [myView addSubView anotherView]; anotherView.alpha = 1; NSLog(@"anotherView alpha = %f"

Set transparent background using ImageMagick and commandline prompt

▼魔方 西西 提交于 2019-11-28 15:12:08
Suppose you have any image (PNG or JPG). This image has a white background and I need to make this background transparent. I have tried with these examples: convert original.png -background none transparent.png convert original.png -background white -flatten -alpha off transparent.png but with no desirable results. How can I make it? IMPORTANT: Using convert command-line. Rijk I am using ImageMagick 6.6.9-7 on Ubuntu 12.04. What worked for me was the following: convert test.png -transparent white transparent.png That changed all the white in the test.png to transparent. Sandeep Pal I had the

Photoshop like background on transparent image

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 14:38:22
I'm making a graphics editor for my class project and i want to make so that when, for example a user loads a picture in to the editor or or draw something in the PictureBox, all the alpha parts are shown the chessboard like background. My idea is that when I create a PictureBox with transparent background set, I create another one behind it, set its BackColor to white and add grey images 50x50, alternately horizontally and vertically. Is that a good approach to the problem? If, not do You have any suggestions? In Photoshop, for example, I create image 1600x1600. When I zoom to a certain level

How To Make Part of Web View Slightly Translucent?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 12:14:07
问题 In Objective-C with Mac OSX Cocoa , is there any way to make a DIV on a WebView slightly translucent so that the desktop applications behind the window bleed through slightly, but only on that DIV and not the rest of the WebView ? Or perhaps I can make the whole WebView translucent, but turn it off for all DIV s except one DIV ? I have a WebView loading a web page. In the web page, I have a sidebar on the left, and then an IFRAME on the right. I click items on the sidebar and they change the

Transparent Png to TBitmap32

不羁岁月 提交于 2019-11-28 11:35:22
I have a png that i would like to load in a TBitmap32. After I load the bitmap I call: Bitmap.DrawMode := dmTransparent; Bitmap.OuterColor := Bitmap.PixelS[0,0]; But then all white pixels are transparent. How can i do that just for the transparent part of the png image? Here is my image with the alpha transparency around the edge of the image indicated in the standard way. And this is the actual image: It seems that TBitmap32 may lose alpha information while loading a PNG image. You may consider to use the GR32PNG library of which a documentation excerpt follows: . . . since reading and

Semi-transparent colors in Google Charts?

喜你入骨 提交于 2019-11-28 08:55:27
问题 A call like chart.draw(data, { colors: ['#e0440e', '#e6693e', '#ec8f6e', ...], ... }); creates a chart with colors looking like semi-transparent. However, we passed RGB colors, with no alpha parameter! In other chart apps (like jqPlot, CanvasJS etc) you may pass rgba calls instead, like in [ 'rgba(255,0,0,0.5)', 'rgba(0,255,0,0.5)', ...] Google Charts does not seem to support this. But is there any other way to pass RGBA custom colors instead, with a simple syntax? PS: there is a somehow

Alpha-gradient on Android

房东的猫 提交于 2019-11-28 06:54:25
I need to create an alpha-gradient on the edge of the ImageView. Preferably using only XML. Image for example 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 android:id="@+id/photo" android:layout_width="match_parent" android:layout_height="match_parent" android

Manually alpha blending an RGBA pixel with an RGB pixel

ぐ巨炮叔叔 提交于 2019-11-28 06:24:47
I am trying to do an alpha blend operation of an RGBA image (foreground image), on to a RGB image (background image). However, while doing so I think I may be doing the wrong alpha blending operation or doing it wrong. For example, the pixel of my RGB image is a grayish color of (127, 127, 127). The pixel of my RGBA image for the pixel will be (0, 0, 255). After I do my blending operation, the final color will be (127, 0, 255). However, I thought that was more of an additive blend and different than the operation I am doing. For how my values are set, take a look at this incPixelColor[0] = 0;