ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Showing a drag image?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Dec 15 2023 : 14:47:04
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?
2   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Dec 16 2023 : 13:59:18
Hi Nigel,

Thanks for the information!

After adapting it to my requirements, it works perfectly now!
xequte Posted - Dec 15 2023 : 18:41:48
Hi Peter

Set IEFileDragDrop1.ShowPreview := True;

Regarding the ImageEnMView crash, are these physical files, or blobs in the database? If you want to allow dragging of blobs, you need to save them to temp files and then initiate dragging

Nigel
Xequte Software
www.imageen.com