Thread: More help with graphics! PLEASE!!!

  1. #1
    Registered User CumQuaT's Avatar
    Join Date
    Sep 2001
    Posts
    73

    Talking More help with graphics! PLEASE!!!

    You guys don't understand... I don't understand hardly anything about C++! The only book I've got is An Idiot's Guide to C++ and I havent even finished that! I just want to learn how to draw a line!!!

    Thanks!
    Why? The often unanswerable question. If it is unanswerable, why answer it?

    Join the Cult of Sheograth, it's the place to be!

    http://cultosheogorath.proboards16.com

    Lord, we know what we are, yet we know not what we may be... Who wrote that anyway? If you know, E-Mail me. [email protected]

    Joy to all the fishes...

    **infected by frenchfry164**

  2. #2
    Registered User kitten's Avatar
    Join Date
    Aug 2001
    Posts
    109
    If you want to draw a line with no programming skills, use windows paint.

    No but seriously now... Drawing graphics with C/C++ just is not that simple. Because under Windows you can't directly access hardware and so on... So under Windows you should use DirectX or OpenGL or any other graphics library. You can look for tutorials but I'd recommend to learn more than basics of C++.
    Making error is human, but for messing things thoroughly it takes a computer

  3. #3
    Registered User kitten's Avatar
    Join Date
    Aug 2001
    Posts
    109
    And besides... If there would be a simple way like DrawLine(x, y, x1, y1); it would've been told on this board a millions of times by now.
    Making error is human, but for messing things thoroughly it takes a computer

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    25
    What are you trying to draw in? A SDI windows program maybe. The simplest way is to get a client DC to draw on(example in MFC) and use the line to function.

    void CMainWnd::OnLButtonDown(UINT nFlags, CPoint point)
    {
    CClientDC dc(this);
    CRect rc;
    GetClientRect(&rt);
    dc.MoveTo(0, (rc.bottom + re.top) / 2);
    dc.LineTo((rc.right + rc.left) / 2, 0);
    dc.LineTo(rc.right, (rc.bottom + rc.top) / 2);
    dc.LineTo((rc.bottom + rc.top) / 2);
    }

    This segment of code will draw a diamond on the client space of a window. Using a device context you can use the LineTo function to draw from two CPoint objects or from raw coordinates.

  5. #5
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    *cough* use DOS *cough*...
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 09:57 AM
  2. Graphics Programming :: Approach and Books
    By kuphryn in forum Windows Programming
    Replies: 4
    Last Post: 05-11-2004, 08:33 PM
  3. egavga.bgi problem
    By sunil21 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-22-2003, 05:06 PM
  4. Graphics Devices and Cprintf clash
    By etnies in forum C Programming
    Replies: 6
    Last Post: 05-09-2002, 11:14 AM