PDA

View Full Version : Color.dll


clueless
04-21-2008, 04:12 PM
Hi there, ive been trying to make use of Ssides color.dll http://www.indigorose.com/forums/attachment.php?attachmentid=6167&d=1207253493
but i cant work it out. The Example he's provided isnt very clear, theres 2 sets of buttons


From HTML = -1
FromName = -65536
FromOle = -256
FromWin32 = -16776961


and


ToHTML = #fffff
ToName = ff000ff
ToOle = 16711680
ToWin32 = 63553


All the buttons give different values , if the destination isnt specified each time the i would guess its the same for each one.
The different answers are probably because he's picking different values to convert each time, there doesnt seem to be any way of working out whats going on.

FromHTML : to what>?
FromName : to what>?

Im not sure which is win32 and which is ole any more,:huh all i really want is to be able to convert between rgb,ole and win32.

sside
04-21-2008, 05:59 PM
FromHtml
Convert a color from html color value to .net color value.

FromName
Convert a color from color name to .net color value.

and so on.

ToHtml
Convert a color from .net color value to html color value.

ToName
Convert a color from .net color value to color name (most likely will return a hex value).

and so on.

Colors table contains .net color values.
Win32Colors table contains win32 color values.

Image.dll uses .net color values. Because in different programming worlds colors may have different values Color.dll will act as a bridge between those worlds and .net and vice versa. (If you remember your post when you input as a parameter a color value returned from another dll).

Or with other words:

FromXxx to .net color value.
From .net color value ToXxx color value.


Another usage could be, for example, if you want to convert a color from win32 value to hex value:


netColorValue = FromWin32(win32ColorValue);
hexColorValue = ToHex(netColorValue);


Another example, convert from argb to win32:


netColorValue = FromArgb(255, 0, 0, 255);
win32ColorValue = ToWin32(netColorValue);


It might be a bit cryptic, but again...

With Kind Regards
sside

clueless
04-22-2008, 03:45 PM
Thanks dude, I made a little demo using your color dll and a color picker dll by Intrigued. http://rapidshare.com/files/109623090/colorDemo.apz

clueless
04-30-2008, 09:19 AM
It would be a good idea to have some way of validating numbers in the various color formats that your dll covers. RGB is easy enough but i don't know how to check if a user has entered a correct win32 or .net color .