Platforms to show: All Mac Windows Linux Cross-Platform

/Picture/BinaryPicture
Feedback.

Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Picture/BinaryPicture
This example is the version from Sat, 13th May 2005.
Notes: Last modified: Sat, 13th May 2005
Class Window1
Inherits Window
// Controls
ControlInstance
Sub Close() Handles Event

End Sub
Sub Paint(g As Graphics) Handles Event
g.drawpicture current,0,0
End Sub
Sub Open() Handles Event

End Sub
End ControlInstance
ControlInstance
Sub Open() Handles Event

End Sub
End ControlInstance

// Properties
Dim original as picture
Dim current as picture

// Event implementations
Sub Open()
create
run
End Sub

// Methods
Sub run()
dim s as string

// compress picture
s=PicturetoBinaryStringMBS(original)

current=BinaryStringtoPictureMBS(s)

size.text=str(lenb(s))+" Bytes"
End Sub
Sub create()
dim g as graphics
dim x as integer
dim y as integer
dim r as RGBSurface
dim w as integer
dim h as integer

original=newpicture(preview.width,preview.height,32)

r=original.RGBSurface
g=original.graphics
w=original.width-1
h=original.height-1

for x=0 to w
for y=0 to h
r.pixel(x,y)=rgb(x*255/w,y*255/h,y*255/h)
next
next


End Sub
End Class

Class App
Inherits Application
End Class





Links
MBS REAL studio Plugins - Pfarrgemeinde St. Arnulf Nickenich