Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I save images from Excel without using Clipboard, in C#?
    primarykey
    data
    text
    <p>I have looked into this fairly extensively, but have not found quite what I am looking for. The two methods I have found are</p> <p>1: Using the Microsoft.Office.Interop.Excel, Iterate through the workbook's shapes, then copy the images to the clipboard and then take the clipboard data and put that into a bitmap, then finally save that bitmap. The problem with this method is the clipboard. We would like this to be used in a multi-threaded environment and are afraid of clipboard issues between threads. We would rather not deal with clipboard-locking.</p> <p>2: Save the file as an .HTML file, then grab the images from the "_files" folder created where the document is saved to. The problem with this is that two images get created for each image (1 high res, 1 low res), and there is no good way to determine which images are low-res and which images are high-res, as they are all named image### and some files list them high, low, high, low, while some list them high, high, low, low. Using all of these files is slow and takes up space, which is not ideal. I could check images by aspect ratios, but this is obviously not great because multiple images could have the same aspect ratio.</p> <p>Is there a way to parse the Excel.Shape directly as a bitmap (or any image format) without using the clipboard? It seems like there must be a way, because the Shape.CopyPicture method is able to send it to the clipboard in an image format. Otherwise, is there a way to do something similar to number 2 without getting duplicates? I would prefer a solution that avoids using 3rd party libraries.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload