最近一个项目相关的技术,需要使用C#读取一个PPT文档中所有幻灯片的图片,代码要怎么写?
各位大虾谁知道的不吝赐教 ...

解决方案 »

  1.   

    FileStream fs = new FileStream(dtcap.Rows[0]["photoPath"].ToString(), FileMode.Open);
                    byte[] imageBuffer = new byte[fs.Length];
                    fs.Read(imageBuffer, 0, imageBuffer.Length);
                    fs.Close();
                    MemoryStream ms = new MemoryStream(imageBuffer);
                    BitmapImage bitmap = new BitmapImage();
                    bitmap.BeginInit();
                    bitmap.CacheOption = BitmapCacheOption.OnLoad;
                    bitmap.StreamSource = ms;
                    bitmap.EndInit();
                    ms.Close();
                    mainFrm.collectionlist.image.Source = bitmap;