Note that there are some explanatory texts on larger screens.

plurals
  1. POGeneral Android semi transparent bug
    primarykey
    data
    text
    <p>I use anti aliasing to make my images more smooth. When using anti aliasing a dark border will be drawn around the images. This happens because Android uses the color black and mixes it with the yellow from the images. This is a gernal problem! When I draw a rectangle and set the alpha value to 127 the image also gets quiet dark. Instead of using black Android should use white to draw the transparency. </p> <p>Is there any workaround how I can handles this problem?</p> <p>Example sourcecode for drawing a semi transparent rectangle to a canvas. The rectangle is dark as well but it should be bright. </p> <pre><code>Bitmap bmp = Bitmap.createBitmap(200, 200, Config.ARGB_8888); Canvas canvas = new Canvas(bmp); Paint rPaint = new Paint(); rPaint.setColor(Color.parseColor("#F7E836")); rPaint.setAlpha(127); rPaint.setStyle(Paint.Style.FILL); canvas.drawRect(0, 0, 100, 100, rPaint); </code></pre> <p>The images are SVG graphics which are rendered with the following library: <a href="http://code.google.com/p/svg-android/" rel="nofollow">http://code.google.com/p/svg-android/</a></p> <p>I think I found the bug. The problem is the SurfaceView. Its background is black. The same semi-transparent bug occurs when I use the code above and display it on an ImageView and the background color of the UI element behind the ImageView is black. The background color of the SurfaceView is always black. If I change this to white with setBackgroundColor, the SurfaceView gets white, but the white background will be drawn OVER all my other images drawn with OpenGL. I think these must be switched. First the background color should be drawn and than the OpenGL stuff.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload