Closed ijbranch closed 3 years ago
in case of TImage, i think, you should set WinTarget instead of Target
I don't understand why that should be? All the other components on the Demo form are seen but not TImage. WinTarget expects a Win HNDL, how does one get that for TImage??
take a look at DropBMPTarget1 in
you must wrap TImage with a helper panel
OK. Working in the 'SimpleTargetDemo' I did that, put the TImage on a TPanel. Added the following code..
procedure TForm1.DropImageTarget1Drop(Sender: TObject; ShiftState: TShiftState; APoint: TPoint; var Effect: Integer); begin // An image has just been dropped on the target - Copy it to // our TImage component Image1.Picture.Assign(DropImageTarget1.Picture); end;
Tried to drag an image to it with the attached the result.
I am still missing something. :-(
The picture I was dragging is a .jpg file and I was dragging it from my Pictures folder.
When I released/dropped the picture nothing happened.
Sry, i can't help, if i not see the complete code
which type is DropImageTarget1?
I am using the SimpleTargetDemo as supplied with D&D. The component is the one already on the from, TDropImageTarget. All I have done att is put the TImage that was on the form, onto a TPanel on the form and added the additional drop code. TargetDemo.zip
Ahhh Ha! Excellent. Thank you. Now I can move forward with my little project. :-) Regards & Tks again, Ian
gladly
Hi Team, Win 10, 64bit. Latest Drag&Drop, D10.4.1. 32bit Apps. My specific need is to be able to drag & drop .jpg files into a Table Blob field via a DBImage component. I installed D&D without issue. I then opened the SimpleTargetDemo just to see how it all fits together. For some reason, DropImageTarget cannot see TImage as a Target. :-( Hmmm. OK, add a DBImage to the Demo, ahh, it can see DBImage as a Target. :-) Build & Run the App, grab a .jpg file and drag it over the DBImage area. All I get is faded image of what I am trying to drop and a Stop symbol. :-( I will be the first to admit I have probably got something wrong but I don't know what. Please advise. Regards & TIA, Ian