SDE中的blob字段,并转换为相应栅格图片文件(转)

IMemoryBlobStreamVariant pMemoryStream = new MemoryBlobStreamClass();
            int row=0;
            IFeatureCursor feaCursor=m_CurFeatureLayer.Search(null,true);
            IFeature feature=feaCursor.NextFeature();
                    DataGridViewTextBoxCell textboxcell = (DataGridViewTextBoxCell)dataGridView2.Rows[pRow].Cells[row];
            pMemoryStream = (IMemoryBlobStreamVariant)feature.get_Value(feature.Fields.FindField("ZDTP"));
            object obj;
            pMemoryStream.ExportToVariant(out obj);
            byte[] img;
            img = (byte[])obj;
            MemoryStream memoryStream = new MemoryStream(img);
            image = Image.FromStream(memoryStream);
            memoryStream.Close();
posted @ 2009-09-22 09:08  gaofei_work  阅读(292)  评论(0编辑  收藏  举报