[Original] Transparent support for the picture in the Nokia API

xiaoxiao2021-03-06  114

Clapton_XPathotmaildotcom

The support of the picture transparent in MIDP1.0 is not clear, but NOKIA's API has given this good support.

Image.createImage (String) and Image.createImage (Byte [], int, int) method in MIDP1.0, can implement the transparency of the image in the Nokia phone.

Further, when it is desirable to obtain a small picture of each slice from a large image of the same size slice, it is usually true in MIDP 1.0:

Image source; // the Source Image

Image clip = image.createImage (Clipwidth, Clipheight);

Graphics g = clip.getgraphics ();

G.DrawImage (Source, POSX, POSY, TOP | LEFT);

However, the standard implementation of MIDP 1.0 does not guarantee that the pictures obtained through the Image.createImage (int W, int H) method can be transparent. Nokia's own API solves this problem:

Clapton_XPathotmaildotcom

Image img = com.nokia.mid.ui.directutils.createImage (100, 100, 0x00000000);

The above code creates a variable picture of 100 * 100 and initializes its background color. The third parameter is the color Argb value, the specific meaning can be referred to [translation] to implement pictures with MIDP 2.0 to gradually enter the effect. The operation of the DRAW is subsequently performed on this image, and a transparent picture can be achieved.

Reference:

Nokia User Interface Programmer Guide (Ch_nokiauiApiguide_1_0.pdf)

转载请注明原文地址:https://www.9cbs.com/read-125102.html

New Post(0)