Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacControls/HTMLViewer Mac/HTMLViewer Image Tests
Required plugins for this example: MBS MacBase Plugin, MBS MacControls Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/HTMLViewer Mac/HTMLViewer Image Tests
This example is the version from Tue, 11th Feb 2013.
Project "HTMLViewer Image Tests.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control web Inherits HTMLViewer
ControlInstance web Inherits HTMLViewer
EventHandler Sub Open() me.LoadURL "http://www.monkeybreadsoftware.de/" End EventHandler
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() if not Targetmacho then MsgBox "This button is Mac OS X only." Return end if dim name as string = "" if TargetCocoa then dim nw as NSWindowMBS = self.NSWindowMBS if nw.backingScaleFactor>1.5 then name = "cocoa-retina" else name = "cocoa" end if else name = "carbon" end if test name, 1 test name, 2 test name, 4 End EventHandler
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Protected Sub Test(name as string, faktor as integer) // Render picture dim n as NSImageMBS = web.RenderWebsiteImageMBS(faktor) dim s as string = n.JPEGRepresentation dim f as FolderItem = SpecialFolder.Desktop.Child(name+" "+str(faktor)+" raw.jpg") dim b as BinaryStream = BinaryStream.Create(f, true) b.Write s n.setSize n.MaximumPixelWidth, n.MaximumPixelHeight // make RB picture dim p as Picture = n.CopyPictureWithMask // save f = SpecialFolder.Desktop.Child(name+" "+str(faktor)+" rb.jpg") f.SaveAsJPEG p End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Filetype application/pdf
Filetype image/jpeg
End FileTypes1
Class Window2 Inherits Window
End Class
End Project

See also:

Feedback, Comments & Corrections

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

MBS Xojo Plugins