如何将图像添加到数据集? [英] how do I add an image to a dataset?

查看:111
本文介绍了如何将图像添加到数据集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将图像添加到数据集中?

how do I add an image to a dataset?

这是一个C#/ Silverlight问题,虽然我试图模仿我在Excel中看到的内容。

This is a C#/Silverlight question although I am trying to emulate what I see in Excel.

在下面的屏幕snapsot中,有一个excel文件,在一列的单元格中有小箭头指示符。 首先,我不知道如何做到这一点。 对于初学者来说,学习是件好事。 但我需要
在C#/ Silverlight应用程序中模拟这个。 我如何将这样的小图形放入数据集/数据网格?

In the screen snapsot below, there is an excel file that has little arrow indicators inside the cells of one column.  First of all, I do not know how even this can be done.  For starters, that would be a good thing to learn.  But I need to emulate this in a C# / Silverlight app.  How would I put little graphics like this into a dataset/datagrid?

 

推荐答案

您可以使用byte []检索图像数据和Imagebyteconverter将其转换为位图并显示 

You can use byte[] to retrieve the image data and Imagebyteconverter to convert it into a bitmap and display 

  System.Windows.Media.Imaging.BitmapImage bi = new System.Windows.Media.Imaging.BitmapImage();

  System.Windows.Media.Imaging.BitmapImage bi = new System.Windows.Media.Imaging.BitmapImage();

                    bi.SetSource(new System.IO.MemoryStream((Byte [])imagevalue));

                    bi.SetSource(new System.IO.MemoryStream((Byte[])imagevalue));

                   返回bi;

                    return bi;

 


这篇关于如何将图像添加到数据集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆