TImageEnView has an amazing feature - it allows an image to be dragged and dropped onto e.g. File Explorer:
// Drag Example:
// Allow image to be dragged from a TImageEnView (to Windows Explorer, for example)
procedure TForm1.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
ssFiles: TStringList;
begin
if GetKeyState(VK_LBUTTON) < 0 then // Mouse left button is down
begin
ssFiles := TStringList.Create;
ssFiles.Text := ImageEnView1.IO.Params.FileName;
IEFileDragDrop1.InitiateDragging( ssFiles, [iedaCopy] );
FreeAndNil(ssFiles);
end;
end;
This would be even better if a semi-transparent drag image were displayed while dragging, like when dragging an image inside File Explorer:
Hi Nigel, do you think you could make this possible?
BTW, I tried the same with the ImageEnMView database demo by dragging a single selected image:
procedure TForm1.ImageEnMView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
ssFiles: TStringList;
begin
if GetKeyState(VK_LBUTTON) < 0 then // Mouse left button is down
begin
ssFiles := TStringList.Create;
ssFiles.Text := ImageEnMView1.SelectedFilename;
IEFileDragDrop1.InitiateDragging( ssFiles, [iedaCopy] );
FreeAndNil(ssFiles);
end;
end;
However, this crashed the program! Is there a way to do this with a single selected image in the ImageEnMView in the database demo?