ScriptSpot

Forum topic · General Scripting

How do you change bitmap color based on color picker? Need some help.

By JokerMartini · 2010-04-29

Description

How do I get the color of the created bitmap to use the color chosen in the Color Picker? It seems like it should be something simple but I am unable to figure it out. Help would be appreciated. Thanks
John


rollout color1 "color"
(
colorpicker theColor "Bar Color: " color:[0,0,255] modal:false

button btnMake "Make" width:140 height:24

on btnMake pressed do
(
bm1=bitmap 100 100 color:red
pasteBitmap bm1 bm1 (box2 0 0 25 50) [100,100]
display bm1
)

)
createDialog color1 150 60
Comments (4)

JokerMartini · 2010-04-29

In the same script how do I go about pasting a string of text over the blue background. Just a simple line of text like "Hello how are you?"

I've been having issues getting that to work right.
Thanks

John

I see your from riverside CA, I'm from Long Beach CA!

Attachments

JokerMartini · 2010-04-29

Alright great. Thanks a ton!

Admin · 2010-04-29

I moved your question to the scripting forum...

To answer your question - you don't need to paste anything into the bitmap you just need to use a variable to store the color from the color picker then create a bitmap directly with that color.


rollout color1 "color"
(
colorpicker theColor "Bar Color: " color:[0,0,255] modal:false

button btnMake "Make" width:140 height:24

on btnMake pressed do
(
curcolor = theColor.color
bm1=bitmap 100 100 color:curcolor
display bm1
)

)
createDialog color1 150 60