/*---------------------------------
* Draw an image
* @ Param X coordinates on the screen
* @ Param y coordinate on the screen
* @ Param w the width of the image to be drawn
* @ Param h the height of the image to be drawn
* @ Param bx x coordinate on the Image
* @ Param by Y coordinate on the Image
*
* @ Return null
------------------------------------*/
Public static void drawimage (canvas, bitmap BLT, int X, int y,
Int W, int H, int BX, int ){
Rect src = new rect (); // picture> original rectangle
Rect DST = new rect (); // screen> Target rectangle
SRC. Left = Bx;
SRC. Top =;
SRC. Right = bx + W;
SRC. Bottom = by + h;
DST. Left = X;
DST. Top = y;
DST. Right = x + W;
DST. Bottom = Y + h;
// Draw the specified bitmap. The bitmap will be automatically scaled/automatically converted to fill the target rectangle.
// The meaning of this method is like re-drawing a bitmap as needed. The bitmap after painting is what we need.
Canvas. drawbitmap (BLT, null, DST, null );
Src = NULL;
DST = NULL;
}
/**
* Draw a bitmap
*
* @ Param canvas
* @ Param bitmap image
* @ Param X coordinates on the screen
* @ Param y coordinate on the screen
*/
Public static void drawimage (canvas, Bitmap bitmap, int X, int y ){
// Draw an image and display the bitmap object on coordinates X and Y.
Canvas. drawbitmap (bitmap, X, Y, null );
}