Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 11-11-2007, 08:37 PM   #1 (permalink)
Forum Expert
 
Marak's Avatar
 
Join Date: Mar 2005
Location: Firmly Seated Infront of the Computer.
Age: 25
Posts: 429
Default Trying to work on a hue's chart in VB.net

Im trying to get the hue's to display in a selectable chart in Vb.net, but not having much luck at the moment, anyone able to point me into the right direction? (i have not done that much work with array's before - which is what im assuming you would use)
__________________


Quote:
****** says: afk need to smoke this joint i rolled
Marak Says: :eek: .... that explains so much about your coding!
Marak is offline   Reply With Quote
Old 11-12-2007, 02:04 AM   #2 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,762
Default

I know this isnt VB but for my GDK program I had to draw hue chart stuff and made this method.

Code:
        public static Color Convert555ToARGB(short hue)
        {
            int red = (((short)(hue >> 10)) & 0x1f) * 8;
            int green = (((short)(hue >> 5)) & 0x1f) * 8;
            int blue = (hue & 0x1f) * 8;
            return Color.FromArgb(red, green, blue);
        }
And what you can do is take Hue.Colors and for each of the short values in Hue.Colors you pass it through this and it will return a 32 bit color to use as you please.
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 11-12-2007, 12:30 PM   #3 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hiding in your room.
Age: 21
Posts: 1,272
Send a message via MSN to arul
Default

Quote:
Originally Posted by Marak View Post
Im trying to get the hue's to display in a selectable chart in Vb.net, but not having much luck at the moment, anyone able to point me into the right direction? (i have not done that much work with array's before - which is what im assuming you would use)
Code:
Public Shared Function GetColorFromHue(ByVal hue As Short) As Color
    Return Color.FromArgb(((hue And &H7C00) >> 7), ((hue And &H3E0) >> 2), ((hue And &H1F) << 3))
End Function
__________________
arul is offline   Reply With Quote
Old 11-12-2007, 01:38 PM   #4 (permalink)
Forum Expert
 
Marak's Avatar
 
Join Date: Mar 2005
Location: Firmly Seated Infront of the Computer.
Age: 25
Posts: 429
Default

Thankyou arul! - and jeff

I dont think i would have figured that one out :P

EDIT:

Thats used for a vectorial graphic draw right? im reading up on those now, definatly have not coded these before :s

Edit 2:

Thankyou i have gotten it to work, sortof haha.
__________________


Quote:
****** says: afk need to smoke this joint i rolled
Marak Says: :eek: .... that explains so much about your coding!

Last edited by Marak; 11-12-2007 at 03:14 PM.
Marak is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5