Thread: Color Picker

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,991
    My Mood
    Flirty

    Color Picker

    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

  2. The Following 23 Users Say Thank You to ac1d_buRn For This Useful Post:

    -Bl00d- (11-27-2012),ademir1 (05-12-2013),Apocalis (07-25-2011),[MPGH]AVGN (01-22-2011),brad52422 (06-27-2012),BSOD (01-31-2011),Dead 4 Real (01-22-2011),Dieorwin (01-22-2011),fakeness (06-10-2012),Fellipe_ctr (02-18-2013),Houston (01-24-2011),jkiller31 (07-31-2011),kotentopf (01-30-2011),LilGho$t (05-16-2012),LionelMessi10 (01-24-2011),matypatty (04-12-2011),NOOB (01-22-2011),pDevice (10-08-2012),pepepdr (07-01-2012),S0aD (04-13-2011),whit (01-22-2011),ZinisterCoder (12-26-2012),|-|3|_][({}PT3R12 (01-22-2011)

  3. #2
    KawaiiSlut's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    419
    Reputation
    16
    Thanks
    86
    Good job

  4. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,305
    Reputation
    170
    Thanks
    2,194
    My Mood
    Flirty
    Good share.

    Though I wish the POS weren't hardcoded.
    Also I dont think this line does what you think it does.
    [highlight=c++]
    if(color.xred && color.xgreen && color.xblue > 0)
    [/highlight]

    Lastly color values as well as screen positions are all positive numbers so the error checking probably isn't needed, but if it is one might want to check for screen coords, since i'm not sure what happen if you take a pos outside of the screen.

    But that's enough nitpicking. Thanks for the share.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. The Following User Says Thank You to why06 For This Useful Post:

    ac1d_buRn (01-22-2011)

  6. #4
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    nice share,,

    But u used sprites.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  7. #5
    speedforyou's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    741
    Reputation
    -59
    Thanks
    108
    My Mood
    Happy
    ive had my own one of theis for a wile thanks anyways tho

    steel o-o's sig =
    = Done , = Not Done

    Leecher 0 =
    Newbie 25 =
    Member 50 =
    Advanced Member 100 =
    H4X0R Member 150 =
    Dual-Keyboard Member 250 =
    Expert Member 500 =
    's Trainer 750 =
    MPGH Expert 1000 =
    Synthetic Hacker 1250 =
    Blackhat Hacker 1500 =
    Whitehat Hacker 2000 =
    's Guardian 2500 =
    Upcoming MPGHiean 3000 =
    MPGH Addict 3500 =
    MPGHiean 4000 =
    MPGH Knight 4500 =
    MPGH Lord 5000 =
    MPGH Champion 5500 =
    MPGH King 6000 =
    MPGH Legend 6500 =
    MPGH God 7000 =
    MPGH God II 7500 =
    MPGH God III 8000 =
    MPGH God IV 8500 =
    MPGH God V 9000 =
    Arun's Slave 9500 =
    Dave's Slave 10000 =

  8. #6
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,991
    My Mood
    Flirty
    Quote Originally Posted by why06 View Post
    Good share.

    Though I wish the POS weren't hardcoded.
    Also I dont think this line does what you think it does.
    [highlight=c++]
    if(color.xred && color.xgreen && color.xblue > 0)
    [/highlight]

    Lastly color values as well as screen positions are all positive numbers so the error checking probably isn't needed, but if it is one might want to check for screen coords, since i'm not sure what happen if you take a pos outside of the screen.

    But that's enough nitpicking. Thanks for the share.
    If i didnt add that error checking, it crashes becuase no number is specified for the RGB color.
    Just something simple. to prevent anything crashing

    Quote Originally Posted by topblast View Post
    nice share,,

    But u used sprites.
    Does it matter? lol

  9. #7
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    Quote Originally Posted by ac1d_buRn View Post


    If i didnt add that error checking, it crashes becuase no number is specified for the RGB color.
    Just something simple. to prevent anything crashing



    Does it matter? lol
    At least it works but look at the texture maping
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  10. #8
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Oh what a pro :O

    <3

  11. #9
    GodHack2's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    645
    Reputation
    38
    Thanks
    762
    My Mood
    Amused
    thanks for sharing this





    beat this bitches ^^^^^^^

    Current Stats : Bored :/


    Respect list :
    Crash !
    Gordon'
    Markoj

  12. #10
    CodeDemon's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    vagina
    Posts
    1,074
    Reputation
    50
    Thanks
    936
    My Mood
    Fine
    Nice work. I did mine the same way back then, using the windows SDK macros, except I used a more sleek sprite.

    Here it is, if anyone wants it:

  13. The Following 2 Users Say Thank You to CodeDemon For This Useful Post:

    ac1d_buRn (01-22-2011),_Fk127_ (02-01-2011)

  14. #11
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,991
    My Mood
    Flirty

    Question

    Quote Originally Posted by CodeDemon View Post
    Nice work. I did mine the same way back then, using the windows SDK macros, except I used a more sleek sprite.

    Here it is, if anyone wants it:
    that looks pretty slick.
    Would be smaller and better to use in menus like mine i think.
    Thanks for that,

  15. #12
    WING's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Where ya from, My nigga?
    Posts
    104
    Reputation
    9
    Thanks
    6
    My Mood
    Psychedelic
    good job GEEZUS!

    THE ONLY THING I THINK ABOUT IS WATERMELON

  16. #13
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Quote Originally Posted by ac1d_buRn View Post
    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!
    The Internet SHOULD Be Illegal

    When you say
    "Java is a great programming language because it works on all platforms"
    it is just like
    "anal sex is great because it works on all genders"

    Are YOU a Troll?

  17. The Following User Says Thank You to kotentopf For This Useful Post:

    ac1d_buRn (01-31-2011)

  18. #14
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,991
    My Mood
    Flirty
    Quote Originally Posted by kotentopf View Post
    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!
    That looks good.
    Glad someone found it usefull

  19. #15
    BSOD's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    181
    Reputation
    31
    Thanks
    35
    Good job. Just trying to implement it in now , i will get a picture one i get it in. Thank you ^_^. +Thank + Rep

Page 1 of 2 12 LastLast