(Code snippets) Use canvas to merge multiple images into one image,

Source: Internet
Author: User

(Code snippets) Use canvas to merge multiple images into one image,

Demand Analysis: based on the number of images on the current webpage, you can press and hold the images on your mobile phone, save the images to your album, or send them to your friends.

DrawCanvas () {var self = this; var imgsrcArray = [require ('@/page/agent/agentexpand/img/bg.jpg'), 'Data: image/jpeg; base64, '+ this. codeUrl]; var canvas = document. createElement ('canvas '); var ctx = canvas. getContext ('2d '); canvas. width = 750; canvas. height = 1333; var imglen = imgsrcArray. length; var drawimg = (function f (n) {if (n 

Call method:


Note: The preceding call uses the vue syntax.

Reference address:

  • Combine multiple images into one image using canvas
  • Using html2canvas to save webpages as images and image Definitions
  • Export the canvas as an image and download it with JS

  • Save the js and bypassing server images to a local machine (html2canvas)

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.