Is there any way to find the RGB value of a pixel in an image that has been drawn after setColor has been used to change the drawing color to something other than 255,255,255? I'm attempting to make a Gui module that uses both greyscale images, and generated rectangles, lines and points, in such a way that I can set the color to like OliveGreen (131,193,124) for instance, and have the lines and rectangles generated be the same color as the greyscale graphics. I suspect my solution may lie in dealing with pixMaps some how, but I have no idea how to go about it.
Here's what I have so far, but its not working properly
Function DrawBox(UpperLeftX%,UpperLeftY%,width%,Height%,R%,G%,B%
SetAlpha(.7)
SetColor(r,g,b)
DrawRect(UpperLeftX,UpperLeftY,Width,Height) 'draws a semi-transparent rectangle for the body of the box
SetAlpha(1)
DrawImage(GuiImage,UpperLeftX-16,UpperLeftY-16,13) 'fancy looking corners from images
DrawImage(GuiImage,UpperLeftX+width,UpperLeftY-16,14)
DrawImage(GuiImage,UpperLeftX-16,UpperLeftY+height,15)
DrawImage(GuiImage,UpperLeftX+width,UpperLeftY+height,16)
SetColor(51 + r Mod 255, 51 + g Mod 255,51 + b Mod 255) 'side lines
DrawRect(UpperLeftX,UpperLeftY-3,width,3)
DrawRect(UpperLeftX,UpperLeftY+height,width,3)
DrawRect(UpperLeftX-3,UpperLeftY,3,Height)
DrawRect(UpperLeftX+width,UpperLeftY,3,Height)
SetColor(108 + r Mod 255,108 +g Mod 255 ,108 +b Mod 255) 'middle stripes
DrawLine(UpperLeftX,UpperLeftY-2,UpperLeftX+width-1,UpperLeftY-2)
DrawLine(UpperLeftX,UpperLeftY+height+1,UpperLeftX+width-1,UpperLeftY+height+1)
DrawLine(UpperLeftX-2,UpperLeftY,UpperLeftX-2,UpperLeftY+Height-1)
DrawLine(UpperLeftX+width+1,UpperLeftY,UpperLeftX+width+1,UpperLeftY+height-1)
SetColor(255,255,255)
endfunction
the colors I'm trying to match are (51,51,51), and (108,108,108) I tried to do it by SetColor(51 + r Mod 255,51 +g Mod 255 ,51 +b Mod 255), and SetColor(108 + r Mod 255,108 +g Mod 255 ,108 +b Mod 255) but that hasn't been working for me. Any help would be greatly appreciated.
|