-
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?
-
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
-
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.
-
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.
-
CreateCompatibleDC(), LoadImage(), etc.
Z.
-
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)
-
#include <windows.h>
Then just use them as normal. No individual declarations for us =).
Z.
-
you see we tell people C++ is hard, but really we're just lazy so one line declares them all for us :p
-
-
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"
-
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.