|
-
Dec 13th, 2001, 08:31 AM
#1
Thread Starter
Good Ol' Platypus
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)
-
Dec 13th, 2001, 09:05 AM
#2
transcendental analytic
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.
-
Dec 13th, 2001, 03:59 PM
#3
Thread Starter
Good Ol' Platypus
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)
-
Dec 13th, 2001, 06:45 PM
#4
Thread Starter
Good Ol' Platypus
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)
-
Dec 13th, 2001, 07:51 PM
#5
CreateCompatibleDC(), LoadImage(), etc.
Z.
-
Dec 13th, 2001, 08:28 PM
#6
Thread Starter
Good Ol' Platypus
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)
-
Dec 13th, 2001, 09:17 PM
#7
#include <windows.h>
Then just use them as normal. No individual declarations for us =).
Z.
-
Dec 13th, 2001, 10:43 PM
#8
Frenzied Member
you see we tell people C++ is hard, but really we're just lazy so one line declares them all for us
-
Dec 14th, 2001, 11:19 PM
#9
Thread Starter
Good Ol' Platypus
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Dec 14th, 2001, 11:26 PM
#10
Thread Starter
Good Ol' Platypus
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)
-
Dec 14th, 2001, 11:54 PM
#11
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|