DragImageBits

K

Klaus

Hi All,

I have some problem of understanding and hope that maybe someone here
can help me.

I want to make some Drag&Drop from a File or link towards my program,
want to catch the file information including the file icon and store
the information to show a similar picture. (So you get a list of images
together with the file links).

What I am doing :

Private Sub ListView1_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles ListView1.DragEnter
If
e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop) Then
e.Effect = DragDropEffects.Link
Try
Dim m As System.IO.MemoryStream =
e.Data.GetData("DragImageBits", True)
Dim i As Image = Image.FromStream(m)
Catch ex As Exception
Debug.Fail(ex.Message)
End Try
Else
e.Effect = DragDropEffects.None
End If
End Sub

Works fine except for
Dim i As Image = Image.FromStream(m)

Here, draging some link or document into ListView1, I get an exception
because of an system.Argument-Exception at
System.Drawing.Image.FromStream(Stream stream, Boolean
useEmbeddedColorManagement) "Invalid Parameter".

What's wrong here? m is filled and looks good to me, am I missing
soething?
Does anyone has any Idea?

Klaus
 
K

Klaus

Any idea? ...

.... ??? Can be that nobody knows?

Anyone knows where to look for or whom to ask?

Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top