|
-
April 12th, 2001, 05:43 AM
#1
Simple drag & drop of images
Any detailed article on the issue of implementing interface with drag & drop capability of image over other image? NOT OLE drag & drop!
I searched MSDN CD but I didn't found any good example or explanation of techniques.
Michael Vlastos
Automation Engineer
Intracom, Research & Development Division
Development Programmes Department
Athens, Greece
-
April 12th, 2001, 07:38 AM
#2
Re: Simple drag & drop of images
I may be able to help you. But I don't understand EXACTLY what you want to do.
Could detail it more, please.
-
April 18th, 2001, 02:04 AM
#3
Re: Simple drag & drop of images
Thank you. For example: I have a picture box with an image on it and next to it I have a 'control panel' with some available images (gif) and I want the user to be able to drag and drop how many images he wants from this control panel over the picture box with the image.
Michael Vlastos
Automation Engineer
Intracom, Research & Development Division
Development Programmes Department
Athens, Greece
-
April 18th, 2001, 09:28 AM
#4
Re: Simple drag & drop of images
I wrote a program to do what you wanted. The actual code is very small. But still I have to post the whole form code.
You'll get an error while loading, simply replace the images in the pictureboxes.
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8175
ClientLeft = 60
ClientTop = 345
ClientWidth = 9495
LinkTopic = "Form1"
ScaleHeight = 545
ScaleMode = 3 'Pixel
ScaleWidth = 633
StartUpPosition = 3 'Windows Default
Begin VB.PictureBox picPanel
Appearance = 0 'Flat
AutoRedraw = -1 'true
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 6255
Left = 6000
ScaleHeight = 415
ScaleMode = 3 'Pixel
ScaleWidth = 143
TabIndex = 1
Top = 480
Width = 2175
Begin VB.PictureBox picMotif
Appearance = 0 'Flat
AutoRedraw = -1 'true
AutoSize = -1 'true
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2175
Index = 2
Left = 360
Picture = "Form1.frx":0000
ScaleHeight = 143
ScaleMode = 3 'Pixel
ScaleWidth = 175
TabIndex = 4
Top = 4440
Width = 2655
End
Begin VB.PictureBox picMotif
Appearance = 0 'Flat
AutoRedraw = -1 'true
AutoSize = -1 'true
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2280
Index = 1
Left = 360
Picture = "Form1.frx":2218
ScaleHeight = 150
ScaleMode = 3 'Pixel
ScaleWidth = 175
TabIndex = 3
Top = 2040
Width = 2655
End
Begin VB.PictureBox picMotif
Appearance = 0 'Flat
AutoRedraw = -1 'true
AutoSize = -1 'true
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 1635
Index = 0
Left = 360
Picture = "Form1.frx":4868
ScaleHeight = 107
ScaleMode = 3 'Pixel
ScaleWidth = 125
TabIndex = 2
Top = 240
Width = 1905
End
End
Begin VB.PictureBox picDest
Appearance = 0 'Flat
AutoRedraw = -1 'true
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 6255
Left = 600
ScaleHeight = 415
ScaleMode = 3 'Pixel
ScaleWidth = 327
TabIndex = 0
Top = 480
Width = 4935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = false
Attribute VB_Creatable = false
Attribute VB_PredeclaredId = true
Attribute VB_Exposed = false
private Sub picDest_DragDrop(Source as Control, X as Single, Y as Single)
Dim lft as Integer, tp as Integer
lft = Left$(Source.Tag, 5)
tp = Right$(Source.Tag, 5)
picDest.PaintPicture Source.Image, X - lft, Y - tp
End Sub
private Sub picMotif_MouseDown(Index as Integer, Button as Integer, Shift as Integer, X as Single, Y as Single)
picMotif(Index).Tag = X & " " & Y
picMotif(Index).Drag vbBeginDrag
End Sub
-
April 18th, 2001, 11:52 AM
#5
Re: Simple drag & drop of images
I have sent you an E-mail containing a simple VB project I haev created, tell me if you haven't recieved it.
-
April 19th, 2001, 12:41 AM
#6
Re: Simple drag & drop of images
Thank you very much! exactly what I wanted!
Michael Vlastos
Automation Engineer
Intracom, Research & Development Division
Development Programmes Department
Athens, Greece
-
July 3rd, 2001, 06:40 PM
#7
Re: Simple drag & drop of images
can i get a copy of this email as well?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|