Xojo Conferences

MBS Xojo Plugin Tutorial Videos

ImageCapture Source

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /kunden/macsw.de/webseiten/monkeybreadsoftware-video/rbformat/rbcode.php on line 244
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete

// Event implementations
Sub Open()
dim flags as integer = ImageCaptureObjectMBS.kICAAllowMultipleImages
dim types(-1) as string
dim m as new ImageCaptureMBS

types.Append "tif"
types.Append "tiff"
types.append "jpg"
types.append "png"

dim files(-1) as string = m.ImportImage(flags, types)

for each data as string in files
ShowPicture data

End Sub

// Methods
Sub ShowPicture(data as string)
dim p as Picture = JPEGStringToPictureMBS(data, true)

if p = nil then
p = TIFFStringToPictureMBS(data)
if p = nil then
p = PNGStringToPictureMBS(data, 0)
end if
end if

if p<>nil then
dim pw as new PicWindow

pw.width = min(p.Width, screen(0).AvailableWidth - pw.left)
pw.height = min(p.Height, screen(0).AvailableHeight - pw.top)

MsgBox "Got a picture, but failed to decode it."
end if

End Sub
End Class

Class PicWindow
Inherits Window
End Class

All movies

MBS Xojo blog