alpha

SpatialPolygonsDataFrame doesn't plot properly when I make the color transparent

孤人 提交于 2019-12-06 09:42:06
I've been struggling with this problem for a few days. I have a shapefile that contains zip code polygons. I'm trying to plot a certain portion of it with a transparent color ( alpha=0.7 ), but some of the polygons at the edge of the plot end up with no color. If alpha=1.0 , all polygons are fine. The shapefile is stored as a Large SpatialPolygonsDataFrame . # Code that you can use (Thanks jbaums) library(rgdal); download.file('http://www.naturalearthdata.com/http//www.naturalearthdata.com/do‌​wnload/110m/cultural/ne_110m_admin_0_countries.zip', {f <- tempfile()}); unzip(f, exdir=tempdir());

Setting an alpha channel when constructing an ImagickPixel

半世苍凉 提交于 2019-12-06 08:33:11
I am new to using ImageMagick. I am using the latest imagick extension (3.1.0rc1) with PHP. However, the documentation for imagick seems to be somewhat sparse. I want to create an ImagickPixel object with an alpha channel. The documentation states that these are some valid color values to pass to the constructor: "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc . I know that it is possible to retrive the alpha value of an ImagickPixel using getColorValue(imagick::COLOR_ALPHA); . So, how can I set an rgb color with an alpha channel during initialization of the object by passing to

Painting in Canvas which fades with time | Strange alpha layering behaviour

会有一股神秘感。 提交于 2019-12-06 02:23:44
问题 I'm painting to a canvas which isn't being cleared and making it so that the canvas either fades to a solid colour over time, or fades in alpha revealing the layer behind. My first instinct was to simply fill a rectangle over the drawing with a low alpha each frame so that the fill colour accumulates gradually fading out the painting. But I found some strange behaviour (to me at least, I'm sure there's a reason). The fill colour never fully accumulates. And the results change depending on

Setting alpha of colorbar in MATLAB R2015b

天涯浪子 提交于 2019-12-06 01:57:34
I would like to set some transparency in my plot which I can do with alpha . This works great but I also want to adapt the colorbar. Here is an example: subplot(2,1,1) A = imagesc(meshgrid(0:10,0:5)); alpha(A,1) colorbar subplot(2,1,2) B = imagesc(meshgrid(0:10,0:5)); alpha(B,.1) colorbar The example is taken from here . On this page two solutions exists but none works for Matlab R2015b. With HG2 graphics (R2014b+) you can get some of the undocumented underlying plot objects and alter the transparency. c = colorbar(); % Manually flush the event queue and force MATLAB to render the colorbar %

iOS UIButton with transparent title on white background

痴心易碎 提交于 2019-12-06 00:11:01
问题 I have a custom UIButton with transparent background and white title. I'm looking for a simple solution to invert it on highlight (white background and transparent title) as it is achieved on system UISegmentedControl . Is there simpler solution than inverting alpha on snapshot used as a CALayer mask? If not, could you tell how can I invert CALayer alpha? 回答1: You can draw the text on a CGContext using Destination Out as blend mode. This code seems to work: - (void)viewDidLoad { [super

Why UIPickerView is semi transparent

牧云@^-^@ 提交于 2019-12-05 21:59:08
Why UIPickerView is not %100 opaque? When I set text color to white and put UIPickerView on a red background, the UIPickerView items have a reddish white text color. I tried custom views using viewForRow , but still no effect. How can I set opacity of UIPickerView to %100? In IB it's alpha is 1 but actually in runtime it isn't Please try this delegate and make your own customize view and return it. -(UIView *)pickerView:(UIPickerView *)pickerView viewForRow: 来源: https://stackoverflow.com/questions/39325827/why-uipickerview-is-semi-transparent

Add alpha to shader in Unity3D

两盒软妹~` 提交于 2019-12-05 19:05:19
I don't have any idea about shader programming but right now I need to add alpha to the shader that I want to use. Actually I want to fade in and fade out my sprite but it's not in the shader that I use. Shader : Shader "Sprites/ClipArea2Sides" { Properties { _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} _Length ("Length", Range(0.0, 1.0)) = 1.0 _Width ("Width", Range(0.0, 1.0)) = 1.0 } SubShader { LOD 200 Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } Pass { Cull Off Lighting Off ZWrite Off Offset -1, -1 Fog { Mode Off } ColorMask RGB Blend

Render to texture problem with alpha

亡梦爱人 提交于 2019-12-05 17:21:46
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-texture code looks like: (I'm using OpenGL ES on the iPhone) // gen framebuffer GLuint framebuffer;

Imagemagick gif overlay preserves alpha on background

做~自己de王妃 提交于 2019-12-05 15:23:31
I am using this code to build an animated gif from a sequence of pngs: convert -dispose previous -resize 400x400 -delay 10 *.png -loop 0 -coalesce -layers Optimize output.gif. it creates a gif with transparency, but when I overlay it over a jpg background, I get a weird result where a transparent box remains in the final image under my moving gif but over the jpg. From my tests, it seems this is a problem with the way I am building the original gif, but I have no idea. Also, I am stuck using GoDaddy's built in version of ImageMagick, which is 6.2.8 and sucks...all help and support seem to be