Results 1 to 3 of 3

Thread: Convert Drag and Drop type from vbCFBitmap to vbCFFiles **RESOLVED**

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    352

    Resolved Convert Drag and Drop type from vbCFBitmap to vbCFFiles **RESOLVED**

    I can drag a jpg or bitmap from Windows Explorer into my app's Image control and display it:

    VB Code:
    1. Private Sub Image1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, Y As Single)
    2. Dim FileName As String
    3. Dim Photo As IPictureDisp
    4.  
    5. FileName = Data.Files(1)
    6. Set Photo = LoadPicture(FileName)
    7.  
    8. Image1.Picture = Photo
    9.  
    10. End Sub

    How can I drag and drop a Picture (not file) from an Image Control to another 3rd party application that is expecting a file (vbCFFiles), like in the vb example, above?

    Somehow on the Image1_OLEStartDrag event, is it possible to pass the filepath to another application as a vbCFFiles type....

    but Data.Files(1) is read only..... bummer

    VB Code:
    1. Private Sub Image1_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
    2.     Data.SetData , vbCFFiles
    3.     Data.Files(1) = ("c:\1.jpg")
    4.    
    5.     AllowedEffects = vbDropEffectCopy
    6. End Sub
    Last edited by easymoney; Jan 14th, 2005 at 04:09 AM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    352

    Re: Convert Drag and Drop type from vbCFBitmap to vbCFFiles

    Is is possible to set Data.Files()?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    352

    Re: Convert Drag and Drop type from vbCFBitmap to vbCFFiles

    Excellent

    Code:
     
        SavePicture Image1.Picture, "c:\temp.bmp" ' save bitmap to file 
    
        Data.SetData , vbCFFiles 
        Data.Files.Add "c:\temp.bmp" 
        AllowedEffects = vbDropEffectCopy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width