Winforms Picturebox控件 [英] Winforms Picturebox control

查看:62
本文介绍了Winforms Picturebox控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据行中有一个图像数据字段(如在Northwinds demo sql

数据库中)。什么是在Winform

图片框控件中显示它的C#指令语法。

-

GSSI

I have an image data field in a datarow (as in the Northwinds demo sql
database). What is the C# instruction syntax to display it in a Winform
picturebox control.
--
GSSI

推荐答案

您好,


您必须先创建位图

将图像保存到临时文件或者到内存流。然后使用

正确的Bitmat构造函数


-

Ignacio Machin,

ignacio。 machin AT dot.state.fl.us

佛罗里达州交通局


GSSI < GS ** @ discussions.microsoft.com>在消息中写道

news:55 ********************************** @ microsof t.com ...
Hi,

You have to create a bitmap first
Save your image to either a temp file or to a memory stream. then use the
correct constructor of Bitmat

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"GSSI" <GS**@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
我在数据行中有一个图像数据字段(如在Northwinds demo sql
数据库中)。什么是在Winform
图片框控件中显示它的C#指令语法。
-
GSSI
I have an image data field in a datarow (as in the Northwinds demo sql
database). What is the C# instruction syntax to display it in a Winform
picturebox control.
--
GSSI



你好GSSI,


在尝试对数据执行任何操作之前,需要删除sql图像类型标题。

将byte []输入MemoryStream。将MemoryStream的位置设置为78(我认为这是标题的大小)。然后使用Image.FromStream(MemoryStream)


2006年4月10日星期一17:10:02 +0200,GSSI< GS ** @ discussion.microsoft.com>写道:
Hi GSSI,

You need to remove the sql image type header before you try to do anything with the data.
Feed the byte[] to a MemoryStream. Set the position of the MemoryStream to 78 (I think this is the size of the header). Then use Image.FromStream(MemoryStream)

On Mon, 10 Apr 2006 17:10:02 +0200, GSSI <GS**@discussions.microsoft.com> wrote:
我在数据行中有一个图像数据字段(如在Northwinds demo sql
数据库中)。什么是在Winform
图片框控件中显示它的C#指令语法。
I have an image data field in a datarow (as in the Northwinds demo sql
database). What is the C# instruction syntax to display it in a Winform
picturebox control.




-

快乐编码!

Morten Wennevik [C#MVP]



--
Happy coding!
Morten Wennevik [C# MVP]





" Morten Wennevik" <莫************ @ hotmail.com>在消息中写道

news:op.s7sun1fhklbvpo@stone ...
Hi,

"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:op.s7sun1fhklbvpo@stone...
嗨GSSI,

你需要删除之前的sql图像类型标题你试图用数据做任何事情。
将byte []输入MemoryStream。将MemoryStream的位置设置为78(我认为这是标题的大小)。然后使用
Image.FromStream(MemoryStream)
Hi GSSI,

You need to remove the sql image type header before you try to do anything
with the data.
Feed the byte[] to a MemoryStream. Set the position of the MemoryStream
to 78 (I think this is the size of the header). Then use
Image.FromStream(MemoryStream)



我从来没有处理来自SQL的图像(或二进制数据)中的标题,我

将文档存储在Image字段中,我永远不需要删除任何部分



-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局


I have never deal with a header in the image (or binary data) from SQL , I
store documents in an Image field and I have never need to remove any part
of it.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


这篇关于Winforms Picturebox控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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