New topic: Create image FileTypes?
<http://forums.realsoftware.com/viewtopic.php?t=47851> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message RicSum Post subject: Create image FileTypes?Posted: Sat May 11, 2013 11:30 am Joined: Fri Jun 05, 2009 4:54 pm Posts: 468 Location: London, England 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. _________________ RealStudio Professional Edition 2012 r2 Developing on OS X 10.8 (Mountain Lion) Deploying on Windows XP / Vista / 7 / 8 Top kermit Post subject: Re: Create image FileTypes?Posted: Sat May 11, 2013 11:56 am Joined: Mon May 30, 2011 12:56 am Posts: 682 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. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
