Platforms to show: All Mac Windows Linux Cross-Platform

Folderitem.QuickLookMBS(MaxWidth as Integer = 500, MaxHeight as Integer = 500, IconMode as Boolean = false, ScaleFactor as Double = 1.0) as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method QuickLook MBS MacFrameworks Plugin 7.7 Yes No No Yes, macOS only No
Function: Creates a thumbnail for the designated file.
Example:
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.jpg")

// shows the icon in 128x128 scaled by factor 4:
Backdrop=f.QuickLookMBS(128,128,true,4)

// shows the icon in default size:
Backdrop=f.QuickLookMBS(128,128,true,0)

// shows preview of image in 128x128 pixels.
Backdrop=f.QuickLookMBS(128,128,false,0)

// shows preview of image in 512x512 pixels.
Backdrop=f.QuickLookMBS(128,128,false,4)

// shows preview of image in 512x512 pixels.
Backdrop=f.QuickLookMBS(512,512,false,0)

// use Icon function in case no preview is available:
Backdrop=f.iconmbs(512)
Notes:
Returns nil if Quick Look does not support this file type. In that case you may use folderitem.Icon() with the given size.

MaxWidth and MacHeight specify the maximum desired size.
If ScaleFactor is bigger than zero, it is used. Else the default value is used.
If IconMode is true, QL will produce an icon (ie a thumbnail and all the icon decor, like shadows, curled corner, etc.).

If you look for a control to show quicklook preview like the finder, please check the QLPreviewPanelMBS window and the QLPreviewViewMBS control.

QuickLook does not provide images for items in special folders like temporary folders.

Some examples using this method:

Feedback, Comments & Corrections

Folderitem.QuickLookMTMBS(MaxWidth as Integer = 500, MaxHeight as Integer = 500, IconMode as Boolean = false, ScaleFactor as Double = 1.0) as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method QuickLook MBS MacFrameworks Plugin 13.2 Yes No No Yes, macOS only No
Function: Creates a thumbnail for the designated file.
Example:
Dim f As FolderItem

f=SpecialFolder.Desktop.Child("test.png")

// shows preview of image in 512x512 pixels.
Backdrop=f.QuickLookMTMBS(512,512,False,0)
Notes:
Same as QuickLookMBS, but thread friendly.

QuickLook does not provide images for items in special folders like temporary folders.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacFrameworks Plugin.

The biggest plugin in space...




Links
MBS Xojo PDF Plugins