P
pierreg06
Hi.
I try to extract (C#) all the pictures embedded in a worksheet by:
* walking thru all the shapes embedded in the current worksheet
* copy the shape into the clipboard
=> Myshape.CopyPicture(Excel.XlPictureAppearance.xlScreen,
Excel.XlCopyPictureFormat.xlBitMap)
* get the image and save it from the clipboard (if Clipboard.ContainsImage()
is true)
=> Clipboard.GetImage().Save(mystream,
System.Drawing.Imaging.ImageFormat.Jpeg)
This works pretty well, excepted that image resolution in the saved files is
poor. For instance, all the images inserted in the Excel Worksheet are around
40k and the file saved are around 4k.
Whatever is the format of my initial images (.jpg, .bmp), I always get a
very low resolution.
Is there anyway to cope with this problem ?
Is there another way to extract images without using clipboard ?
Many thanks in advance for your help,
Pierre
I try to extract (C#) all the pictures embedded in a worksheet by:
* walking thru all the shapes embedded in the current worksheet
* copy the shape into the clipboard
=> Myshape.CopyPicture(Excel.XlPictureAppearance.xlScreen,
Excel.XlCopyPictureFormat.xlBitMap)
* get the image and save it from the clipboard (if Clipboard.ContainsImage()
is true)
=> Clipboard.GetImage().Save(mystream,
System.Drawing.Imaging.ImageFormat.Jpeg)
This works pretty well, excepted that image resolution in the saved files is
poor. For instance, all the images inserted in the Excel Worksheet are around
40k and the file saved are around 4k.
Whatever is the format of my initial images (.jpg, .bmp), I always get a
very low resolution.
Is there anyway to cope with this problem ?
Is there another way to extract images without using clipboard ?
Many thanks in advance for your help,
Pierre