我试图将位图图像保存到数据库
Bitmap map = new Bitmap(pictureBoxMetroMap.Size.Width, pictureBoxMetroMap.Size.Height);
Run Code Online (Sandbox Code Playgroud)
我imgcontent在数据库中使用数据类型创建了一个列binary但我的问题是如何将此bitmap(映射)转换为二进制数据?
我如何从数据库中检索数据?
我用谷歌搜索它,我发现这样的东西,但它不起作用:
byte[] arr;
ImageConverter converter = new ImageConverter();
arr = (byte[])converter.ConvertTo(map, typeof(byte[]));
Run Code Online (Sandbox Code Playgroud)