Click to See Complete Forum and Search --> : Simple drag & drop of images
Dr_Michael
April 12th, 2001, 05:43 AM
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
javalar
April 12th, 2001, 07:38 AM
I may be able to help you. But I don't understand EXACTLY what you want to do.
Could detail it more, please.
Dr_Michael
April 18th, 2001, 02:04 AM
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
shree
April 18th, 2001, 09:28 AM
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
javalar
April 18th, 2001, 11:52 AM
I have sent you an E-mail containing a simple VB project I haev created, tell me if you haven't recieved it.
Dr_Michael
April 19th, 2001, 12:41 AM
Thank you very much! exactly what I wanted!
Michael Vlastos
Automation Engineer
Intracom, Research & Development Division
Development Programmes Department
Athens, Greece
corymillican
July 3rd, 2001, 06:40 PM
can i get a copy of this email as well?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.