Platforms to show: All Mac Windows Linux Cross-Platform
/MacClassic/Picture Scroll Test
Required plugins for this example: MBS Picture Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacClassic/Picture Scroll Test
This example is the version from Mon, 5th May 2019.
Project "Picture Scroll Test.xojo_binary_project"
FileTypes
Filetype text
Filetype any
End FileTypes
Class Window1 Inherits Window
Control Slider1 Inherits Slider
ControlInstance Slider1 Inherits Slider
EventHandler Sub ValueChanged()
run
End EventHandler
End Control
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect)
if b<>Nil then
g.DrawPicture b,0,0
end if
End EventHandler
End Control
Control Slider2 Inherits Slider
ControlInstance Slider2 Inherits Slider
EventHandler Sub ValueChanged()
run
End EventHandler
End Control
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
EventHandler Sub Action()
run
End EventHandler
End Control
Sub run()
if b=nil then
b = new Picture(testimage.Width,testimage.Height,32)
end if
if p=nil then
p = new Picture(testimage.Width,testimage.Height,32)
end if
p.Graphics.DrawPicture testimage,0,0
p.Mask.Graphics.ForeColor=&c000000
p.Mask.Graphics.FillRect 0,0,p.Width,p.Height
p.Mask.Graphics.ForeColor=&c777777
p.mask.Graphics.FillRect 0,100,p.Width,100
if p.ScrollMBS(Slider1.Value,Slider2.Value,CheckBox1.Value,true) then
Title="Ok "+str(Slider1.Value)+" "+str(Slider2.Value)
else
Title="Fail "+str(Slider1.Value)+" "+str(Slider2.Value)
end if
b.Graphics.ForeColor=rgb(255,200,200)
b.Graphics.FillRect 0,0,p.Width,p.Height
b.Graphics.DrawPicture p,0,0
Canvas1.Invalidate
End Sub
Property Protected b As Picture
Property p As Picture
Property testimage As picture
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
EventHandler Sub Open()
dim p as Picture
dim f as FolderItem
f=GetOpenFolderItem("any")
if f<>nil then
p = f.OpenAsPicture
Window1.testimage=p
window1.run
end if
End EventHandler
End Class
End Project
The items on this page are in the following plugins: MBS MacClassic Plugin.