Phpexcel Export picture Size setting issues

Source: Internet
Author: User
When using Phpexcel to export pictures to Excel, the image size will only be displayed in a certain proportion, not according to their own requirements display size, do not know how to solve, there is a big God to help me?
$objDrawing = new phpexcel_worksheet_drawing ();
$objDrawing->setname (' Photo ');
$objDrawing->setdescription (' Image inserted by PYXJM ');
$objDrawing->setpath ('. '). $data [' lic_litpic ']);
$objDrawing->setwidth (' 122pt ');
$objDrawing->setheight (' 200pt ');
$objDrawing->setcoordinates (' G2 ');
$objDrawing->setoffsetx (2);
$objDrawing->getshadow ()->setvisible (true);
$objDrawing->setmimetype (Phpexcel_worksheet_memorydrawing::mimetype_default);
$objDrawing->setworksheet ($objPHPExcel->getactivesheet ());


Reply to discussion (solution)

$objDrawing->setheight (122);//Photo height
$objDrawing->setwidth (200); Photo width

$objDrawing->setheight (122);//Photo height
$objDrawing->setwidth (200); Photo width


1 floor This can't be solved oh I have tried before ....

$objDrawing->setheight (122);//Photo height
$objDrawing->setwidth (200); Photo width


It's been solved, and no one will give it to you.

Reference to the 1 floor of the reply:

$objDrawing->setheight (122);//Photo height
$objDrawing->setwidth (200); Photo width

It's been solved, and no one will give it to you.


To solve the problem and to say the exact process.
If everyone has this dedication
I guess you wouldn't need to ask this question here, would you?

$objDrawing->setresizeproportional (FALSE);
The default is to scale by the original image, set to false.
Landlord does not share not kindness.

  • 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.