Creating a Graphics Module

Try this:

https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePicturesWIN.zip

Simon.

Awesome.

image link
Thanks

Picture to String.

The grey square is not accepting any image ( have tried jpg and png ) to be dropped. Just shows a red circle with diagonal line with the mouse pointer.

[quote=187703:@Dave OBrien]Picture to String.

The grey square is not accepting any image ( have tried jpg and png ) to be dropped. Just shows a red circle with diagonal line with the mouse pointer.

[/quote]
Yes, I have seen that too.

As I am not a Windows user I can’t explain that. Maybe some other people can explain why the DropObject section is not working.

The ‘Make Graphics Module’ section does work, though. Try that out for the folder.

Simon.

Hi Simon

Module section works if I use the folder selection option ( round green arrows ) but if I copy / paste a path into the source textbox, then I get this :

Same with the destination. Will not accept a typed in destination location - must be selected with the folder selection dialog.

So either needs to work with the text string, or disable the text string and show the selection made with the folder dialog display in a label ?

does the canvas (I assume its a canvas) have an acceptfile drop handler with suitable images defined in a filetype ?
It doesn’t seem to based on how things respond when I drag an image over it

just did a test here, and code from this page :
link text

Found that the DropObject code needed to be in the event for the window, and not for the canvas control.

Hope this helps in some way.

Can send you the test app I made if you want.

works for me in the dropobject of a canvas just fine

Odd. are there properties that must be set for the canvas, backdrop, etc ?

You must calld AcceptFileDrop with the appropriate filetypes, somewhere in the canvas, preferably in the Open event. Note that you are drag/dropping a file, not an image, so AcceptPictureDrop has no effect.

Hi Norman

Are you saying that you can also produce the same drop error that I reported on Simon’s app ?

I have zipped my test project where the dropobject of the window will catch the drop of a jpg file, but the dropobject of the canvas ( when uncommented and the dropobject of the window is commented out ) will not catch it.

Can anyone test this to confirm my findings, and possibly determine what is wrong that the dropobject event of the canvas can not catch the drop ?

link zip

Dave

If you call Canvas1.AcceptFileDrop, then it works fine.

Thank You Tim.

Was starting to wonder if something serious was wrong.

Really appreciate the correction.

[quote=187755:@Dave OBrien]Hi Norman

Are you saying that you can also produce the same drop error that I reported on Simon’s app ?
[/quote]
Only if I only have an AcceptPictureDrop in my canvas
Once I add a file type set & the image types to it and AcceptFileDrop for them things work and I get a folderitem reference on every drop

Should now work on both platforms.

Mac: https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePictures.zip
Windows: https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePicturesWIN.zip

Report any problems, please.

Simon.

Hi Simon

Drop is working now. Well Done, and Thanks.

The solution was interesting (well, at least for me!).

On the Mac all I had to do was place the following code in the Canvas Open event:

me.AcceptPictureDrop me.AcceptFileDrop("image/jpeg")
And, of course, the acceptance code in the DropObject event.

This did not work on the Windows version as you found out. I had not defined a new FileType in my App as was pointed out in this thread. So, I created a Filetype with image/jpeg and changed the Open event to:

me.AcceptPictureDrop me.AcceptFileDrop(DropImage.All)
and it worked on both Mac and Windows.

Norman - can you advise me why there is this difference?

Simon.

[quote=187781:@Simon Berridge]
Simon Berridge May 16 Europe (Wiltshire, UK)

Should now work on both platforms.

Mac: https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePictures.zip
Windows: https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePicturesWIN.zip

Report any problems, please.

Simon.[/quote]

Error 404 … can you please provide again Simon ?

The Mac-Version is on Simon’s Homepage

I am on Windows.