Jump to content

drag and drop images from web browser to GUI


corz
 Share

Recommended Posts

We've been able to drag images out of web browsers since forever. Can I drag one into my GUI?

Or rather, can I drag an image from my web browser onto my GUI and have my app *do* something with that image?

My fingers bleed from searching. Any ideas much appreciated!

;o) Cor

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

The title says it all, really. Is it possible to drag an image from a web browser (say, Chrome) and have it *do* something in my app, aside from a the "Don't Bother" cursor?

I could have sworn I had a GUI that accepted drags from browsers but I can't pin it down. My web searching is just as fruitless.

Anyone have any clues?

;o) Cor

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

lol! I forgot I'd already asked! Cheers for noticing. Feel free to delete either post, of course.

I guess no answers means no one knows. Och well.

;o) Cor

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

  • Moderators
14 hours ago, corz said:

I guess no answers means no one knows. Och well.

Or you're being impatient or haven't provided a detailed explanation as to what you're trying to accomplish...

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

In short you should first register the WM_DROPFILES message in your gui with something like this: GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") and then manage the dropped images within your WM_DROPFILES() function.
For an example have a look to this script by @UEZhttps://www.autoitscript.com/forum/topic/190642-ascii-art-kaleidoscope/?do=findComment&comment=1368827
Following the example by UEZ I've also used it in this other my script: https://www.autoitscript.com/forum/topic/190921-tsp-art-generator

In both above example scripts you can drag an images from a browser and drop it on the GUI where it is catched and used as needed.

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Chimp, thanks!

Trouble is, I already use WM_DROPFILES messages. I was accessing the DLL directly rather than using the WinAPI UDF (I hadn't noticed those functions) so I tried switching over to the UDF versions (much leaner code, thanks!) but it made no difference.

I then tried fiddling with the GUICreate style attributes (looking at your example GUIs), but again with no effect.

I ran the Kaleidoscope program (nice!) but on my system, dragging images from a web browser into it window won't work. Just like with my own app I get the "NO ENTRY" icon and nothing happens.

Is this all supposed to work?

Could there be something up with my system, perhaps? A security setting or something?

;o) Cor

Edited by corz

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

I just tried, and: if I drag from firefox to the GUI everything works fine, but if I drag from IE I get a "no entry" icon. Since I normally use firefox I did not notice this "nice" feature of IE. If you drag an image from a folder from your hard drive it should work too (can you confirm?)
(I am not surprised by these oddities generated by IE ... often rather than simplify things with IE are further complicated ....)

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

I'm using Chrome. I don't even have Firefox installed right now. Hadn't tried IE.

Most peeps use Chrome nowadays so I'd like it to work there.

;o) Cor

ps. I just tried it in Edge. It works! Uses the path to the cached image, though, rather than the URL.

Edited by corz

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...