Steve-vfp9user
Programmer
Hello all
Firstly, credit to Cetin Basoz who posted the following in the Microsoft Developer Network (Visual Foxpro General) back in 2009:
The above creates a form which allows me to drag an image from a Windows Folder and drop it on the form where it displays perfectly.
I would like to take this one step further by storing the image dropped onto the form in a table field. I am fully aware that images can quickly add up to the 2GB limit in tables but I will be able to sort out something for that.
So using the above, is there a way to store the dropped image to a field (any name will do e.g. photo, image etc?)
Appreciate any guidance.
Thank you
Steve Williams
VFP9, SP2, Windows 10
Firstly, credit to Cetin Basoz who posted the following in the Microsoft Developer Network (Visual Foxpro General) back in 2009:
Code:
Public oForm
oForm = Createobject("sampleForm")
oForm.Show()
Define Class sampleForm As Form
Height=320
Width=320
Add Object myImage As Image With ;
Left = 10,Top=10,Height=300,Width=300,OLEDropMode=1,Stretch=1
Procedure myImage.OLEDragOver
Lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
If m.nState = 0 And oDataObject.GetFormat( 15 )
This.OLEDropEffects = 5
This.OLEDropHasData = 1
Else
This.OLEDropEffects = 0
This.OLEDropHasData = 0
Endif
Endproc
Procedure myImage.OLEDragDrop
Lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
If oDataObject.GetFormat( 15 )
Local Array laData[1]
oDataObject.GetData(15,@laData)
This.Picture = laData[1]
Endif
Endproc
Enddefine
The above creates a form which allows me to drag an image from a Windows Folder and drop it on the form where it displays perfectly.
I would like to take this one step further by storing the image dropped onto the form in a table field. I am fully aware that images can quickly add up to the 2GB limit in tables but I will be able to sort out something for that.
So using the above, is there a way to store the dropped image to a field (any name will do e.g. photo, image etc?)
Appreciate any guidance.
Thank you
Steve Williams
VFP9, SP2, Windows 10