Platforms to show: All Mac Windows Linux Cross-Platform
/Picture/Picture with Color Palettes/Color palettes
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Picture/Picture with Color Palettes/Color palettes
This example is the version from Sat, 13th May 2005.
Notes: Last modified: Sat, 13th May 2005
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Picture/Picture with Color Palettes/Color palettes
This example is the version from Sat, 13th May 2005.
Notes: Last modified: Sat, 13th May 2005
Class Window1
Inherits Window
// Controls
ControlInstance
Sub Action() Handles Event
run new PaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewGrayPaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewWebPaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewSystemPaletteMBS
End Sub
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
Sub MouseMove(X As Integer, Y As Integer) Handles Event
dim n as integer
if pal<>nil then
n=x\16+(y\16)*16
thiscolor.text=hexc(pal.col(n))
end if
End Sub
Sub Paint(g As Graphics) Handles Event
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewRedPaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewGreenPaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewBluePaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewWindowsPaletteMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
run NewPalmPaletteMBS
End Sub
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
Sub Action() Handles Event
dim p as picture
dim pal as PaletteMBS
p=newpicture(100,100,8)
pal=p.PaletteMBS
run pal
End Sub
End ControlInstance
// Properties
Protected Dim pal as paletteMBS
// Event implementations
Sub Open()
End Sub
// Methods
Sub run(p as paletteMBS)
dim pic as picture
dim g as graphics
dim i,l,x,y as integer
dim c as color
list.deleteAllRows
if p=nil then
pic=nil
Colorcount.text=""
else
pic=newpicture(256,256,32)
if pic<>nil then
g=pic.graphics
if g=nil then
pic=nil
else
i=0
for x=0 to 15
for y=0 to 15
c=p.col(i)
g.foreColor=c
g.fillrect y*16,x*16,16,16
list.addrow str(i)
l=list.lastIndex
list.cell(l,1)=strc(c)
list.cell(l,2)=hex(c.red)+" "+hex(c.green)+" "+hex(c.blue)
i=i+1
next
next
end if
end if
Colorcount.text=str(p.countColors)+" colors in palette."
end if
can.backdrop=pic
pal=p
End Sub
Function strc(c as color) As string
return str(c.red)+" "+str(c.green)+" "+str(c.blue)
End Function
Function hexc(c as color) As string
return right("00"+hex(c.red),2)+" "+right("00"+hex(c.green),2)+" "+right("00"+hex(c.blue),2)
End Function
End Class
Class App
Inherits Application
End Class
See also:
- /Picture/Picture blending/blend with mask
- /Picture/Picture blending/blend without plugin
- /Picture/Picture blending/blend with plugin
- /Picture/Picture Blending test
- /Picture/Picture Blur
- /Picture/Picture Combine
- /Picture/Picture Combine Test
- /Picture/Picture Copy Fast Test
- /Picture/Picture Difference
- /Picture/Picture manipulation
- /Picture/Picture Matrix/matrix without plugin
- /Picture/Picture Matrix/matrix with plugin
- /Picture/Picture MinMax/mmx_demo
- /Picture/Picture MinMax/mmx_demo with plugin
- /Picture/Picture Mirror
- /Picture/Picture Scale/Picture.ScaleMBS
- /Picture/Picture Scale/Scale Compare
- /Picture/Picture Scale/Scale Test
- /Picture/Picture To Memoryblock
- /Picture/Picture To String
- /Picture/Picture with Color Palettes/NewPalPicture
- /Picture/Picture with Color Palettes/Picture Palette Calculation
Links
MBS Realbasic Plugins - Nachhilfe in Wassenach