none
VSTO + PowerPoint + Problem exporting image real size RRS feed

  • Question

  • Hello,

    I'm trying to export a picture to HD with VSTO using:

    shape.Export(myPath, PowerPoint.PpShapeFormat.ppShapeFormatPNG, 0, 0, PowerPoint.PpExportMode.ppScaleXY);

    but it saves the picture with a strange size. Let's say that the image in slide has 300x250, it returns a picture with 150x140, this is the size of the picture in the slide scale to fit the screen.

    How can i get the image real size in the slide (scale 100%)?

    Saturday, February 23, 2013 3:07 PM

Answers

All replies

  • Hi Felipe Avelar,

    Thank you for posting in the MSDN Forum.

    Why don't you use the value of shape.Width and shape.Height property as the ScaleWidth and ScaleHeight parameter of shape.Export method?

    Besides, according to Shape.Export Method the method is reserved for internal use. 

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 26, 2013 9:15 AM
    Moderator
  • Hello Quist,

    thanks for your answer. Well, I tried use shape.Width and Height, but when I did it, the image was exported smaller than before, another observation is that shape.Height and Width are floats and the scales parameters are int.

    There's some other method to export a image (picture shape)?

    Thanks for your attention.

    Tuesday, February 26, 2013 9:30 PM
  • Hi Felipe,

    The return value of shape.Width and Height property are in points. You can then convert the value to pixels by using PointsToPixels Method.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Felipe Avelar Wednesday, February 27, 2013 12:25 PM
    Wednesday, February 27, 2013 7:04 AM
    Moderator
  • Hi Quist,

    thanks for your help. I used the method to convert points and resized the image. (:

    Your posts were really helpful

    Wednesday, February 27, 2013 12:30 PM