Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking

    [Help] Drawing shape's

    Can some 1 post all the drawing thing's like drawline drawcircle drawbox and stuff please.... and how to use them,
    Ty.

  2. #2
    Mr.Magicman's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Sitting in my cave full of thoughts learning Asembly
    Posts
    2,103
    Reputation
    16
    Thanks
    646
    My Mood
    Cold
    Check codedeamons stickied thread

  3. The Following User Says Thank You to Mr.Magicman For This Useful Post:

    wassup40 (10-03-2010)

  4. #3
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking
    Il go check it again iam pretty sure it doesnt explain about drawing shape's
    edit: just check only drawcrosshair and drawbox.

  5. #4
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored

    Exclamation

    Quote Originally Posted by wassup40 View Post
    Il go check it again iam pretty sure it doesnt explain about drawing shape's
    What is there to explain



    Code:
    void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
    {
        D3DRECT rec = { x, y, x + w, y + h };
        pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
    }
    Code:
    void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
        FillRGB( x, (y + h - px), w, px,    BorderColor, pDevice );
        FillRGB( x, y, px, h,                BorderColor, pDevice );
        FillRGB( x, y, w, px,                BorderColor, pDevice );
        FillRGB( (x + w - px), y, px, h,    BorderColor, pDevice );
    }

    Code:
    void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
        FillRGB( x, y, w, h,        BoxColor, pDevice );
        DrawBorder( x, y, w, h, 1,    BorderColor, pDevice );
    }

    Code:
    void DrawCrosshair(LPDIRECT3DDEVICE9 pDevice, int size, int strong,  D3DCOLOR xcolor)
    {
        int iCenterX = GetSystemMetrics( 0 ) / 2;
        int iCenterY = GetSystemMetrics( 1 ) / 2;
        if( iCenterX < 20 && iCenterY < 20 )
        {
            iCenterX = ( GetSystemMetrics( 0 ) / 2 );
            iCenterY = ( GetSystemMetrics( 1 ) / 2 );
        }
        D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
        D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
        pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 1000,  0);
        pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 100,  0);
    }
    Dont ban me

  6. The Following User Says Thank You to markoj For This Useful Post:

    wassup40 (10-03-2010)

  7. #5
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking
    Quote Originally Posted by markoj View Post
    What is there to explain



    Code:
    void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
    {
        D3DRECT rec = { x, y, x + w, y + h };
        pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
    }
    Code:
    void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
        FillRGB( x, (y + h - px), w, px,    BorderColor, pDevice );
        FillRGB( x, y, px, h,                BorderColor, pDevice );
        FillRGB( x, y, w, px,                BorderColor, pDevice );
        FillRGB( (x + w - px), y, px, h,    BorderColor, pDevice );
    }

    Code:
    void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
        FillRGB( x, y, w, h,        BoxColor, pDevice );
        DrawBorder( x, y, w, h, 1,    BorderColor, pDevice );
    }

    Code:
    void DrawCrosshair(LPDIRECT3DDEVICE9 pDevice, int size, int strong,  D3DCOLOR xcolor)
    {
        int iCenterX = GetSystemMetrics( 0 ) / 2;
        int iCenterY = GetSystemMetrics( 1 ) / 2;
        if( iCenterX < 20 && iCenterY < 20 )
        {
            iCenterX = ( GetSystemMetrics( 0 ) / 2 );
            iCenterY = ( GetSystemMetrics( 1 ) / 2 );
        }
        D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
        D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
        pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 1000,  0);
        pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 100,  0);
    }
    Just line's i want shape's !

  8. #6
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    Quote Originally Posted by wassup40 View Post

    Just line's i want shape's !
    Well you can draw a box and a circle with that, are you asking for like Trianlges and Pentagons, etc?
    Dont ban me

  9. The Following User Says Thank You to markoj For This Useful Post:

    wassup40 (10-03-2010)

  10. #7
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking
    I wanna draw a circle..... and im not gonna spend hour's trying to draw a circle with line's....

  11. #8
    C00lGuy's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    136
    Reputation
    16
    Thanks
    304
    My Mood
    Busy
    Code:
    ID3DXLine *pLine;
    #define PI 3.14159265
    
    void DrawShape(int X, int Y, int radius, int numSides, DWORD Color)
    {
        D3DXVECTOR2 Line[128];
        float Step = PI * 2.0 / numSides;
        int Count = 0;
        for (float a=0; a < PI*2.0; a += Step)
        {
            float X1 = radius * cos(a) + X;
            float Y1 = radius * sin(a) + Y;
            float X2 = radius * cos(a+Step) + X;
            float Y2 = radius * sin(a+Step) + Y;
            Line[Count].x = X1;
            Line[Count].y = Y1;
            Line[Count+1].x = X2;
            Line[Count+1].y = Y2;
            Count += 2;
        }
        pLine->Begin();
        pLine->Draw(Line,Count,Color);
        pLine->End();
    }
    Wi th this you can draw how ever many sides you want now this is a Crosshair source so edit it up a bit to accommodate your needs.

    And to draw a circle the numsides would be 50

  12. The Following User Says Thank You to C00lGuy For This Useful Post:

    wassup40 (10-03-2010)

  13. #9
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking
    Quote Originally Posted by C00lGuy View Post
    Code:
    ID3DXLine *pLine;
    #define PI 3.14159265
    
    void DrawShape(int X, int Y, int radius, int numSides, DWORD Color)
    {
        D3DXVECTOR2 Line[128];
        float Step = PI * 2.0 / numSides;
        int Count = 0;
        for (float a=0; a < PI*2.0; a += Step)
        {
            float X1 = radius * cos(a) + X;
            float Y1 = radius * sin(a) + Y;
            float X2 = radius * cos(a+Step) + X;
            float Y2 = radius * sin(a+Step) + Y;
            Line[Count].x = X1;
            Line[Count].y = Y1;
            Line[Count+1].x = X2;
            Line[Count+1].y = Y2;
            Count += 2;
        }
        pLine->Begin();
        pLine->Draw(Line,Count,Color);
        pLine->End();
    }
    Wi th this you can draw how ever many sides you want now this is a Crosshair source so edit it up a bit to accommodate your needs.

    And to draw a circle the numsides would be 50
    How would i use it?

    Well... i got it working but it dc's me straight away.
    i used this
    Code:
    DrawShape(500,500,5,10,Green);
    if thats right idk why it dc's me.
    Last edited by wassup40; 10-03-2010 at 10:37 AM.

  14. #10
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    Quote Originally Posted by wassup40 View Post

    How would i use it?

    Well... i got it working but it dc's me straight away.
    DrawCircle(X,Y,10,50,D3DCOLOR_ARGB( 255, 255 , 0 ,0));
    And you D/C because you probably didnt create the line?
    Dont ban me

  15. #11
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking
    Quote Originally Posted by markoj View Post
    DrawCircle(X,Y,10,50,D3DCOLOR_ARGB( 255, 255 , 0 ,0));
    And you D/C because you probably didnt create the line?
    Still dc...
    What ya mean create the line what line.

  16. #12
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    Quote Originally Posted by wassup40 View Post


    Still dc...
    What ya mean create the line what line.
    Actually where are you drawing it?
    Dont ban me

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

    wassup40 (10-03-2010)

  18. #13
    wassup40's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    I dont know help me
    Posts
    2,238
    Reputation
    28
    Thanks
    789
    My Mood
    Lurking
    In renderframe....

  19. #14
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    Quote Originally Posted by wassup40 View Post
    In renderframe....
    Lol that tells me nothing, whos base is it?
    Dont ban me

  20. The Following User Says Thank You to markoj For This Useful Post:

    wassup40 (10-03-2010)

  21. #15
    Mr.Magicman's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Sitting in my cave full of thoughts learning Asembly
    Posts
    2,103
    Reputation
    16
    Thanks
    646
    My Mood
    Cold
    You must init pLine... ID3DXLINE

  22. The Following User Says Thank You to Mr.Magicman For This Useful Post:

    wassup40 (10-03-2010)

Page 1 of 2 12 LastLast

Similar Threads

  1. (help) draw my hack into opertion 7
    By tremaster in forum Visual Basic Programming
    Replies: 9
    Last Post: 11-09-2010, 05:42 PM
  2. [Help] Drawing pixels on screen?[Solved]
    By master131backup in forum Visual Basic Programming
    Replies: 14
    Last Post: 11-04-2010, 03:55 AM
  3. [HELP] Drawing Radar
    By gcflames12 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 19
    Last Post: 08-16-2010, 04:23 AM
  4. [Help] Draw in the center?
    By mastermods in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 3
    Last Post: 07-25-2010, 01:39 PM
  5. [HELP] Draw direct to screen.
    By Jason in forum Visual Basic Programming
    Replies: 6
    Last Post: 07-25-2010, 12:35 PM