Canvas. drawbitmap (bitmap, SRC, DST, paint)

Source: Internet
Author: User
//  Gameview. drawimage (canvas, mbitdesttop, midtx, mbitqq. getheight (), mbitdesttop. getwidth (), mbitdesttop. getheight ()/2, 0, 0 );      Public   Static   Void Drawimage (canvas, bitmap BLT, Int X, Int Y, Int W, Int H, Int BX, Int  By ){ //  X and Y indicate the starting point of painting, Rect src = New Rect (); //  Image Rect DST = New Rect (); //  Screen position and size  //  SRC: indicates the size of the painting image. SRC. Left = Bx; //  0, 0 SRC. Top = By; SRC. Right = Bx + W;//  Mbitdesttop. getwidth ();, which is the width of the desktop image, SRC. Bottom = by + h; //  Mbitdesttop. getheight ()/2;  //  This is half the height of the desktop image.  //  The following DST indicates the position of the image to be painted. DST. Left = X; //  Midtx,  //  This can be changed, that is, the starting point X of the drawing. DST. Top = y; //  Mbitqq. getheight (); //  This is the height of the QQ image. It is equivalent to the Y coordinate of the start point of the desktop image painting. DST. Right = x + W; //  Midtx + mbitdesttop. getwidth ();  //  Indicates the upper right corner of the image to be painted DST. Bottom = Y + h; //  Mbitqq. getheight () + mbitdesttop. getheight ();  //  Indicates the bottom right corner of the image to be painted Canvas. drawbitmap (BLT, SRC, DST, Null ); // The first parameter of this method is the original image size, and the second parameter is the image size to be displayed. That is to say, if you want to paint a certain part of the image, instead of all the images, the third parameter indicates the position of the image.  SRC = Null  ; DST = Null  ;} 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.