DIB - Memorystream [英] DIB - Memorystream

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

问题描述




我尝试将DragDrop设置为Picturebox,从IE中拖动图像。

但是我被困在这里:

If(e.Data.GetDataPresent(" DeviceIndependentBitmap"))然后

PictureBox1.Image =

e.Data.GetData(" DeviceIndependentBitmap")

结束如果


问题是,a无法做到这一点因为

e.Data.GetData(" ; DeviceIndependentBitmap")是一个内存流,我该怎么办?b $ b用这个来制作图像?


我在NET上看到了一些例子,但它们是全部用C#。


提前致谢

Hi,

I try to make a DragDrop to a Picturebox, to drag images from IE.
But i''m stuck here :
If (e.Data.GetDataPresent("DeviceIndependentBitmap")) Then
PictureBox1.Image =
e.Data.GetData("DeviceIndependentBitmap")
End If

The problem is, that a cannot make this because
e.Data.GetData("DeviceIndependentBitmap") is a memorystream, what can i do
to make a image with this ?

I saw some example on the NET, but they were all in C#.

Thanks in advance

推荐答案

使用System.Drawing.Bitmap类。它有一个接受流对象的构造函数。


-

问候,

Anand M

VB.NET MVP


http://www.dotnetindia.com

" LoSTMaN"写道:
Use the System.Drawing.Bitmap class. It has a constructor that accepts a stream object.

--
Regards,
Anand M
VB.NET MVP

http://www.dotnetindia.com
"LoSTMaN" wrote:


我尝试将DragDrop设置为Picturebox,从IE中拖动图像。
但是我被卡住了这里:
if(e.Data.GetDataPresent(" DeviceIndependentBitmap"))然后
PictureBox1.Image =
e.Data.GetData(" DeviceIndependentBitmap")
结束如果

问题是,a无法做到这一点,因为e.Data.GetData(DeviceIndependentBitmap)是一个内存流,我该怎样做才能制作一个图像这个?

我在NET上看到了一些例子,但它们都在C#中。

提前致谢
Hi,

I try to make a DragDrop to a Picturebox, to drag images from IE.
But i''m stuck here :
If (e.Data.GetDataPresent("DeviceIndependentBitmap")) Then
PictureBox1.Image =
e.Data.GetData("DeviceIndependentBitmap")
End If

The problem is, that a cannot make this because
e.Data.GetData("DeviceIndependentBitmap") is a memorystream, what can i do
to make a image with this ?

I saw some example on the NET, but they were all in C#.

Thanks in advance



嗨Lostman,


这很简单

dim abyt()as byte''作为示例bytearray

Dim ms As New IO.MemoryStream(abyt)

Me.PictureBox1.Image = Image.FromStream(ms)''或任何结果其他图片

对象


我对您的拖拽代码感兴趣,我可以看到它,当不在这个新闻组时

而不是通过电子邮件。

我的电子邮件地址很容易翻译我想想。


Cor


Hi Lostman,

It is very simple
dim abyt() as byte ''as the sample bytearray
Dim ms As New IO.MemoryStream(abyt)
Me.PictureBox1.Image = Image.FromStream(ms) '' or any result other image
object

I am intrested in your drag code, may I see it, when not in this newsgroup
than by email.
My email adres is easy to translate I think.

Cor



*" LoSTMaN" <螺***** @ cablevision.qc.ca> scripsit:
* "LoSTMaN" <lo*****@cablevision.qc.ca> scripsit:
我尝试将DragDrop设置为Picturebox,从IE中拖动图像。
但是我被困在这里:
if(e.Data.GetDataPresent( DeviceIndependentBitmap))然后
PictureBox1.Image =
e.Data.GetData(" DeviceIndependentBitmap")
结束如果

问题是,那个无法做到这一点,因为e.Data.GetData(DeviceIndependentBitmap)是一个内存流,我该怎样做才能用这个做图像?
I try to make a DragDrop to a Picturebox, to drag images from IE.
But i''m stuck here :
If (e.Data.GetDataPresent("DeviceIndependentBitmap")) Then
PictureBox1.Image =
e.Data.GetData("DeviceIndependentBitmap")
End If

The problem is, that a cannot make this because
e.Data.GetData("DeviceIndependentBitmap") is a memorystream, what can i do
to make a image with this ?




未经测试(!):


\\\

Me.Picture1.Image = Image.FromStream(TheMemoryStream)

///


-

Herfried K. Wagner [MVP]

< URL:http ://dotnet.mvps.org/>



Untested (!):

\\\
Me.Picture1.Image = Image.FromStream(TheMemoryStream)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


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

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