GC plotting, image copying

Source: Internet
Author: User

GC plotting, image copying
Method prototype:
@ Param image the source Image
@ Param srcx the X coordinate in the source image to copy from
@ Param srcy the Y coordinate in the source image to copy from
@ Param srcwidth the width in pixels to copy from the source
@ Param srcheight the height in pixels to copy from the source
@ Param destx the X coordinate in the destination to copy
@ Param desty the Y coordinate in the destination to copy
@ Param destwidth the width in pixels of the destination rectangle
@ Param destheight the height in pixels of the destination rectangle
Public void drawimage (image, int srcx, int srcy, int srcwidth, int srcheight, int destx, int desty, int destwidth, int destheight ){

Eg:
GC. drawimage (image, 0, 0, rect. Width, rect. Height, 0, rect. width/2, rect. Height/2 );

GC. drawimage (image, 6, 44,162,193, 162,193 );
Indicates copying an image area of 162*193 size from the position (6, 44) of the image and placing it in a rectangle of 162*193 size at the position (2, 2) of the target.
If the target area is smaller than the source image copy size, the image is compressed; otherwise, the image is stretched.

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.