我在我的Form
中動態添加一堆文件到。如何獲取所選文件的縮略圖並在PictureBox中顯示?
當我顯示OpenFileDialog
時,我允許用戶選擇一個文件。當用戶選擇一個文件,我想:
a) If the file is an image, display a thumbnail of that image in the Panel, and
b) If the file is _not_ an image, display its File Icon in the Panel.
我也無法理解如何區分一個Image
文件和normal file
之間(沒有做大規模的IF
聲明的所有不同的圖像類型。那麼你會怎麼做?)
我們該怎麼做?我已經搜索,但我還沒有找到任何有助於解釋如何解決這個問題。
至於a),抱歉,但你有沒有至少搜索「c#thumbnail」? – Alexander
@Alexander,而不是_exactly_「c#thumbnail」,但約有20個其他變體。 –