Originally Posted by
ac1d_buRn
Well i decided to release my color picker i made becuase i really only done it for fun.
I was going to put it in the DirectX section, But it will get more views here.
All it is, is a sprite, with a simple GetPixel to get the color of the selected mouse reigon.
You can then use that color to use on Chams, ESP, Crosshairs, Anything that you need to specify a color for really.
I have included the sprite bytes in a notepad file. as it is too big to post here.
Code:
RGBColors color;
class RGBColors
{
public:
int xred;
int xgreen;
int xblue;
};
You will also need the class to use the colors whereva you want.
Thanks to GodHack2 for this.
Code:
D3DXVECTOR3 POS;
POS.x = 20;
POS.y = 600;
POS.z = 0;
Sprite->Begin(D3DXSPRITE_ALPHABLEND);
Sprite->Draw(MenuTexture,NULL,NULL,&POS,0xFFFFFFFF);
Sprite->End();
That do draw the sprite.
Code:
POINT pos;
GetCursorPos(&pos);
if(pos.x > 10 && pos.x < 285 && pos.y > 570 && pos.y < 737)
{
POINT pos;
GetCursorPos (&pos);
if(GetAsyncKeyState(VK_LBUTTON)<0)
{
HDC hScreenDC = GetDC (NULL);
COLORREF Colors = GetPixel (hScreenDC, pos.x, pos.y);
ReleaseDC (NULL, hScreenDC);
color.xred = GetRValue (Colors);
color.xgreen = GetGValue (Colors);
color.xblue = GetBValue (Colors);
}
NewText(20, 580, White, " X-Hair Color:");
if(color.xred && color.xgreen && color.xblue > 0) FillRGB( 100, 582, 80, 10, D3DCOLOR_XRGB(color.xred,color.xgreen,color.xblue), pDevice); //if(color.xred && color.xgreen && color.xblue > 0 -- some simple error handeling
}
The main function of code to get the color from the selected reigon.
Code:
if(CH_xhair) {
if(color.xred && color.xgreen && color.xblue > 0) DrawCrosshair(pDevice,15,1,D3DCOLOR_XRGB(color.xred,color.xgreen,color.xblue));
}
And an example of how to use the color
If you do use this, Please credit me.
Also, Here is the sprite image.
And how it looks in ca ( minus the tabs and background)
acid_buRn
your one is of the released one the simplest, thats good.
simple = not much code
not much code = not much work
etc.
i complettly rewrited it and made my personal one
and a snippet
Code:
void cGUI::DrawColorPicker(LPDIRECT3DDEVICE9 pDevice,cButton &Button,COLOR &Col)
{
if(Button.Return){
if(SPRCR){
D3DXCreateTextureFromFileInMemory(pDevice,&Color,sizeof(Color),&D3D.Settings.MenuTexture);
D3DXCreateSprite(pDevice,&D3D.Settings.Sprite);
SPRCR = false;
}
D3D.Draw.Box(29,438,264,163,1,0x8D04A0A0,0xFF030303,pDevice,true,false);
D3D.Draw.String(33,440,0xFF3DFFFF,D3D.Settings.pFont,"Color:");
D3D.Draw.FillRGB(62,442,183,11,Col.ConvertToDWORD(),pDevice,false);
D3D.Draw.String(60,585,LightAvacado,D3D.Settings.pFont,"Thx ac1d_buRn for the Idea. Its not copied!");
D3DXVECTOR3 POS;
POS.x = 33;
POS.y = 457;
POS.z = 0;
D3D.Settings.Sprite->Begin(D3DXSPRITE_ALPHABLEND);
D3D.Settings.Sprite->Draw(D3D.Settings.MenuTexture,NULL,NULL,&POS,0xFFFFFFFF);
D3D.Settings.Sprite->End();
if(Hack.Readys.MouseIsIn(33,457,288,584))
{
if(GetAsyncKeyState(1))
{
HDC TheHDC = GetDC (NULL);
DWORD Colors = GetPixel (TheHDC, Hack.Values.MousePos.x, Hack.Values.MousePos.y);
ReleaseDC (NULL, TheHDC);
Col.Red = GetRValue (Colors);
Col.Green = GetGValue (Colors);
Col.Blue = GetBValue (Colors);
}
}
CloseC.Draw(pDevice);
if(CloseC.Return){
Button.Return = false;
CloseC.Return = false;
}
}
}
U GET MY THANKS AND +REP!