我的情况是这样的,我的图片以二进制格式存放在数据库中,如何将图片从数据库中取出,然后将图片写入word中

解决方案 »

  1.   

    http://blog.sina.com.cn/s/blog_4acbea900100dy8j.html
    http://zhidao.baidu.com/question/53407792
      

  2.   

    试试  FreeTextBox 很好用 也很简单。 网上有的是源码
      

  3.   

     wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
                object oEndOfDoc = "\\endofdoc";
                // wordApp.Selection.EndKey(ref unit, ref Nothing);
                // wordApp.Selection.InlineShapes.AddPicture(strImgPath, ref Nothing, ref objt, ref Nothing);
                Microsoft.Office.Interop.Word.Range wrdRng = wordDoc.Books.get_Item(ref oEndOfDoc).Range;
                Microsoft.Office.Interop.Word.InlineShape oShape;
                oShape = wrdRng.InlineShapes.AddPicture(strImgPath, ref Nothing, ref Nothing, ref Nothing);
                oShape.Width = 350f;
                oShape.Height = 150f;
      

  4.   

    protected void addPhoto(string imgsrc, Range range)
            {
                object LinkToFile = false, SaveWithDocument = true;
                object Range = System.Reflection.Missing.Value;
                InlineShape inLineShape;
                String imgFile = String.Empty;
                imgFile = Server.MapPath(imgsrc);
                try
                {
                    range.Text = "";
                    inLineShape = range.InlineShapes.AddPicture(imgFile, ref   LinkToFile, ref   SaveWithDocument, ref   Range);
                    inLineShape.Width = 120;
                    inLineShape.Height = 30;            }
                catch (Exception e)
                {
                    throw;
                    //Console.WriteLine(e.Message);
                }
                return;
            }
      

  5.   

    插入现有图片是这样,实在不行就把二进制存一下图片,导完了再删掉好了object yiliaofuwu = doc.Books.get_Item(ref obj_yiliaofuwu).Range;
    appWord.Selection.InlineShapes.AddPicture("yes.png", ref nothging, ref nothging, ref yiliaofuwu);