Use ewebedit in Asp.net to narrow down the uploaded Image

Source: Internet
Author: User

The customer requested that the size of the image to be uploaded in ewebeditor should not be limited. If the image is too large, the image must be reduced.

The solution is as follows:

In dialogunder the ewebeditorfolder, there is a file named img.htm. One of the statements is:

Shtml = '

Add a sentence:

Onload = "javascript: If (this. width> 550) This. Height = (this. Height/This. width) * 550; this. width = 550 ;"

Changed:

Shtml = ' 550) This. height = (this. height/This. width) * 550; this. width = 550; "src =" '+ sfromurl +' "'+ shtml;

As long as the image width exceeds 550, the image will be displayed according to the original image proportion, and the image will not be overly stretched or widened.

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.