Java uses graphics2d picture overlay

Source: Internet
Author: User

/** * Image Overlay (Overlay map compressed to width*height size, overlay to bottom) *  * @param basefilepath basemap * @param coverfilepath Overlay * @param x Start x axis * @param Y Start y axis * @param width cover Width * @param height coverage length * @return * @throws Exception */public static bufferedimage coverimage (S Tring Basefilepath, String coverfilepath, int x, int y, int width, int height) throws Exception{file basefile = new File (b Asefilepath);//basemap BufferedImage buffimg = Imageio.read (basefile); File Coverfile = new file (Coverfilepath); Cover layer BufferedImage coverimg = Imageio.read (coverfile); buffimg = Coverimage (buffimg, coverimg, x, y, width, height); return buffimg;}

  

/** * Image Overlay (Overlay map compressed to width*height size, overlay to bottom) *  * @param basebufferedimage basemap * @param coverbufferedimage Overlay * @param x Start x Axis * @param y start y axis * @param width cover Width * @param height coverage length * @return * @throws Exception */public static BufferedImage Co Verimage (BufferedImage basebufferedimage, bufferedimage coverbufferedimage, int x, int y, int width, int height) throws Ex ception{//Create the Graphics2D object, use the Basemap object to draw graphics2d g2d = Basebufferedimage.creategraphics ();//Draw G2d.drawimage ( Coverbufferedimage, x, y, +, NULL); G2d.dispose ();//release system resources used by the graphics context return basebufferedimage;}

  

Java uses graphics2d picture overlay

Related Article

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.