blitzUI

Community Forums/Developer Stations/blitzUI

Rook Zimbabwe(Posted 2005) [#1]
I am just trying to make a little color picker using blitzUI and I got some help using the sliders to change numbers from 0 to 255. All is good. NOW I have a dilemma.

I used createimage to create an image to display in imagebox.

How can I color this image with Blitz... I can color a mesh or a sprite... I can't color an image.

CODE DELETED AND FIXED BELOW
Any ideas?


Conan(Posted 2005) [#2]
Yeah, use the ColorPicker command that comes with the BlitzUI ;)
Jk, but you SHOULD look at it... might give you ideas


Erroneouss(Posted 2005) [#3]
Guess you didn't my reply to your old post on this:
Graphics 800, 600, 16, 2
SetBuffer BackBuffer(  )
HidePointer

Include "blitzui.bb"

;Load fonts and mouse cursors
;and collect information
Initialise(  )

;Window
win001 = Window( 193, 79, 248, 232, "ColoRACK", "0", 1, 0, 1, 1 )

gn=CreateImage(32,32,1)  ; creates the image to color
imgbox001 = ImageBox( 16, 28, 102, 114, gn, 1, 0, 1 )

lbl001 = Label( 13, 175, rval, 0 ) 
lbl002 = Label( 54, 175, gval, 0 ) 
lbl003 = Label( 94, 175, bval, 0 ) 
lbl004 = Label( 15, 160, "RED", 0 ) 
lbl005 = Label( 49, 160, "GREEN", 0 ) 
lbl006 = Label( 95, 160, "BLUE", 0 ) 
sld002 = Slider( 135, 32, 96, 29, 0.0, 0.0, 255.0, 0, 0, "4,1,0", "255,59,52" ) 
sld003 = Slider( 135, 103, 96, 29, 0.0, 0.0, 255.0, 0, 0, "0,1,4", "69,72,255" ) 
sld004 = Slider( 135, 68, 96, 29, 0.0, 0.0, 255.0, 0, 0, "1,4,3", "68,178,109" ) 

Repeat

	;Draw the GUI and update the mouse
	UpdateGUI(  )
	
	;Event Handling
	Select app\Event
		Case EVENT_WINDOW
			Select app\WindowEvent
			End Select
		Case EVENT_MENU
			Select app\MenuEvent
			End Select
		Case EVENT_GADGET
			Select app\GadgetEvent
			End Select
	End Select
	
	; ################################################################
	; My problem initially is here... I just want to get teh value from the 
	; slider... NOPE
	; IS IT JUST ME?
	
	rval=SendMessage( sld002, "SM_GETVALUE" )
	bval=SendMessage( sld003, "SM_GETVALUE" )
	gval=SendMessage( sld004, "SM_GETVALUE" )

	If SendMessage( lbl001, "LM_GETTEXT")<> rval 
	SendMessage( lbl001, "LM_SETTEXT", rval )
	EndIf
	SendMessage( lbl002, "LM_SETTEXT", gval )
	SendMessage( lbl003, "LM_SETTEXT", bval )
	
	Color rval,gval,bval 
	
	;Draw the mouse 
	DrawMouse(  ) 
	
	;Reset all GUI events 
	ResetEvents(  ) 

	Flip
	Cls

Until KeyHit( 1 ) Or app\Quit = True
;Free all images and controls created by BlitzUI
Destroy(  )
End



Rook Zimbabwe(Posted 2005) [#4]
TheDuck, Nope I got that! You did a real great job of it and the numbers now sequence great... I was just wondering how to change the color of the square I created as an image for the imagebox. There was no way in B3D to change the color of an image created in the program that I could figure out... ColorPicker command... Hmmm I didn't see that in the command set.

{EDIT} Colorpicker example helped a great deal! This is the completed code and it works now. I am going to try and figure out how to make it tell you the HTML color code as well (IF I CAN!)

Thanks for all your help!

-RZ