Real Software Forums
http://forums.realsoftware.com/

Create image FileTypes?
http://forums.realsoftware.com/viewtopic.php?f=10&t=47851
Page 1 of 1

Author:  RicSum [ Sat May 11, 2013 11:30 am ]
Post subject:  Create image FileTypes?

Hello all,
In my app I have an image well, which I want users to be able to drop image files onto.

I have the following code in the imagewell's dropObject event:

If Obj.PictureAvailable then
me.image=obj.picture
Elseif Obj.FolderItemAvailable then
me.image=Picture.Open(obj.FolderItem)
End if


I understand that I also need to create the FileTypes, and then add them as acceptedFileTypes via the app's properties editor.

The Language Reference states that a file type is created using the code below:

Dim jpegType As New FileType
jpegType.Name = "image/jpeg"
jpegType.MacType = "JPEG"
jpegType.MacCreator = "prvw"
jpegType.Extensions = "jpg;jpeg"

Dim pngType As New FileType
pngType.Name = "image/png"
pngType.MacType = "PNG "
pngType.MacCreator = "ogle"
pngType.Extensions = "png"

Dim f As FolderItem
//using the addition and conversion operators...
f = GetOpenFolderItem( jpegType + pngType )


Could someone please tell me where I place this code, as I put it into the window's open event, but when I try to add them to the app's list of accepted filetypes - none are displayed in the list editor??

Thank you all in advance.

Author:  kermit [ Sat May 11, 2013 11:56 am ]
Post subject:  Re: Create image FileTypes?

Those file types are transient: they only exist for as long as that event.
Use Project/Add/File Type Set
to create a permanent, app -wide definition.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/