Create FolderItem in memory

Is it possible to create a FolderItem in memory? I receive images from a dll and don’t need to save them but need to display some of them. My current code looks like this, the problem is the continues hard diisk use. I receive a picture every 30 msec.

//global scan_pict as picture
dim scan_fname as string
dim scanFi as FolderItem

scan_fname = "C:\\Users\\Hanspeter\\image.png"
res = FuncProcessGetImage(cam, scan_fname, IMG_PROCESS_BEST)
if res then  // load the picture
  scanFi = GetFolderItem(scan_fname)
  scan_pict = Picture.Open(scanFi)
  canScan.Invalidate                                                   // show scan_pict in canvas
end if

[quote=83775:@Hanspeter Bleuler]Is it possible to create a FolderItem in memory? I receive images from a dll and don’t need to save them but need to display some of them. My current code looks like this, the problem is the continues hard diisk use. I receive a picture every 30 msec.
[/quote]
Unless the DLL is putting them in the disk there’s no reason you couldn’t just use an image directly in memory & never touch the disk
But this code isn’t writing it to disk - it’s reading it so something else is putting it on disk (the DLL maybe ?)

But no you can’t create an “in memory folder item”

The function you’re calling takes a file path. Is there a function you can call that would return the image directly, instead of writing it to disk? (Ie., maybe you’re using the wrong function for what you want to achieve.)

On the other hand, it looks like you’re reusing the same file over and over again, so you’re not eating up much disk space. Unless speed is a problem, it should be fine the way it is.

On Mac you could just use a disk image created from Disk Utility which will then be in RAM, and be so much faster than the hard disk. And it will work without changing your code.

You can even open the virtual disk by using folderitem.Launch on the dmg file.

you can use Picture.FromData function:
http://documentation.xojo.com/index.php/Picture.FromData

Michael - Great idea. I will try this on the Mac version of my app. Is ther anything like this on Windows?
Christian - The DLL I’m using asks for a path and saves the picture there. I will contact the DLL supplier and investigate the options.

I am not terribly familiar with virtual disk technology and Windows.

I found some references, though :

Microsoft documentation is as usual obfuscated as hell, but they do mention it.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd323684(v=vs.85).aspx

These two seem more understandable by non autistic people :
http://www.howtogeek.com/howto/5291/how-to-create-a-virtual-hard-drive-in-windows-7/
http://www.wikihow.com/Create-a-Virtual-Hard-Drive-in-Windows-8