Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Reviewing the Android doc (which looks based on JSE with a completely alternative GUI), the following will get you a alpha-channel supporting image:</p> <pre><code>Bitmap bmp=createBitmap(100,100,Bitmap.Config.ARGB_8888); </code></pre> <p>As long as the <em>source</em> bitmap is alpha supporting, you should be able to paint it onto another bitmap and have it's alpha values honored.</p> <p>To fade it out, you will need to repeatedly paint the image with some suitable delay (but event driven from a timer, not in a loop, unless Android's rendering system is very different from other Javas) manipulating the alpha channel for each pixel on each successive paint.</p> <pre><code>// Make image more transparent by 50% int[] pxls=new int[100*100]; bmp.getPixels(pxls,0,100,0,0,100,100); for(int xa=0,len=pxl.length; xa&lt;len; xa++) { int alp=(pxls[xa] &amp; 0xFF000000); alp&lt;&lt;1; pxls[xa]=(alp | (pxls[xa] &amp; 0x00FFFFFF); } bmp.setPixels(pxls,0,100,0,0,100,100); </code></pre> <p>Caveat 1: I wrote this code in-situ from the JavaDoc; it has not been compiled or tested.</p> <p>Caveat 2: If the hardware device color resolution does not support an alpha-channel (commonly known as 32 bit color), painting of any images to the underlying graphics system <em>may</em> simply ignore the alpha-channel). But any compositing you do before then on a back-buffer image should be respected. The point being you may <em>have</em> to use double-buffered painting to do alpha blending while being immune to the underlying device capabilities/config.</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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