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();
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();