Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::GeorgeS's Tools

Development::GeorgeS's Tools A forum just for GeorgeS's tools

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 06-01-2007, 04:53 AM
Kayot
Discordant
 
Join Date: Sep 2006
Location: Subsection 185.D354 C.12
Posts: 346
Default

^-^ For Item Tint colors, I figure I should pass along what I've figured out.

The color numbers are huge, Heres why.

I don't suggest hex at all, unless you want to hex and then dehex the number. Instead use a function to break it down.

Here's what I used (Sort of, I'm retyping it from my memory)

Code:
Public Function ItemColor(ByVal Value as Long) as Color
	Dim Alfa as Byte = Value / 16777216
	Dim Red as Byte = (Value - (Byte1 * 16777216)) / 65536
	Dim Green as Byte = (Value - (Byte1 * 16777216) - (Byte2 * 65536)) / 256
	Dim Blue as Byte = (Value - (Byte1 * 16777216) - (Byte2 * 65536)) - (Byte3 *
	Color = Color.FromArgb(Alfa , Red , Green , Blue )
End Function
Then to use it in say, a Label with a right click pop-up color dialog, set it like this (I'm typing this so expect mistakes in the syntax.)

Code:
Private Sub ClickEvent(stuff that gens here) Handles label1.click
	lable1.backgroundcolor = ItemColor(reader.Getstring(#))
End Sub
reader is my SQL reader, The getstring is syntax and the # is the column it pulls the data from. You could replace it with any number that is a Long or smaller. If pulling from a TextBox, don't forget the Clng(TextBox.Text) or else it'll give you a convert error.

If you'd like, I could make a function that puts them back together, though it's easer to just make a one line multiplyer.

Code:
lngValue = lable1.backgroundcolor.color.A * 16777216 + lable1.backgroundcolor.color.R * 65536 + lable1.backgroundcolor.color.G * 256 + lable1.backgroundcolor.color.B
__________________
If at first you don't succeed destroy all evidence that you ever tried.

God doesn't give second chances... Hell, he sets you up the first time.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:23 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3