Results 1 to 11 of 11

Thread: Graphics in C++

  1. #1

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Graphics in C++

    As you might know I've always been pretty good with graphics in VB. Now that I've stepped the line to C++, it's pretty neat but doesn't come without its difficulties. Say I just wanted to load a bitmap, get its bits, and change them without showing the picture. Or anything, really. What would I need to do this?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Same api's you've used in vb, LoadImage, BitBlt, Getpixel, SetPixelv...

    btw i recommend you learn the language first, there's whole load of new concepts that you should learn before starting with the api's. Have a look at the faq for tutorials
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I've read Learning VB5 by that guy with the white toupee hair and glasses 2 times over and I think I understand the whole bit.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Okay, so anyways. I want to create a DC and edit it, etc. What you do in VB is create an StdPicture and then use the LoadBitmap command to get it. What I want to know is what the C++ equivalent is.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Zaei
    Guest
    CreateCompatibleDC(), LoadImage(), etc.

    Z.

  6. #6

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Hmmm. Thanks for that Zaei!

    The only thing is I don't know how to declare API calls. I don't even know if I can use them in my console app, but I think I can (WIN32 Console App)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7
    Zaei
    Guest
    #include <windows.h>

    Then just use them as normal. No individual declarations for us =).

    Z.

  8. #8
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    you see we tell people C++ is hard, but really we're just lazy so one line declares them all for us

  9. #9

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Wow. Awesome.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  10. #10

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Just one question- I want to use GetTickCount but I can't seem to get the right type. It won't cast: "cannot convert from 'unsigned long (__stdcall *)(void)' to 'unsigned long'
    This conversion requires a reinterpret_cast, a C-style cast or function-style cast"
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  11. #11
    Zaei
    Guest
    Have to, Have to, HAVE TO add the parens in functions calls. None of this GetTickCount VB stuff. It has to be GetTickCount(), with nothing in the parens.

    Z.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width