i think this is a newbie question...
Based on what you said that you were writing text-based applications, I assume you don''t know DirectX. You can''t use a DirectDraw function without actually going through all the initialization and such. There is Blt(), but you can''t just throw it in the middle of your code and expect it to work. You have to initialize DirectDraw and stuff. You''ll also need to write your own bitmap loader, or you could use LoadBitmap() from the Win32 API.
www.winprog.org
they have some easy to comprehend tutorials.
"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden
they have some easy to comprehend tutorials.
"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden
------------------------------Put THAT in your smoke and pipe it
so, that must be why the code is always so long... i have seen a couple examples that are long (most were long to free the memory after the program is closed), and a lot of stuff about "HBITMAP" and "BITMAP" classes... a also heard about "LOADFROMFILE" that could be put into the declaration of the LoadImage() function from the ddraw.h file, but i''m never told where the filename should go...
LoadImage is from the Win32 API, not from DirectDraw. It is defined as:
hinst is the instance handle to your application. It is passed to WinMain when the program starts. lpszName is where you either specify the name of the resource, or in your case, the filename. uType is the type of image to load. Use IMAGE_BITMAP here. cxDesired and cyDesired is the dimensions you want the bitmap to be loaded in, use 0 if you want the bitmap to retain its normal size. fuLoad should be LR_LOADFROMFILE if you want to load from a file, but it can be a combination of other flags as well. The function returns an HBITMAP which you can blit to a surface.
HANDLE LoadImage( HINSTANCE hinst, LPCTSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT fuLoad );
hinst is the instance handle to your application. It is passed to WinMain when the program starts. lpszName is where you either specify the name of the resource, or in your case, the filename. uType is the type of image to load. Use IMAGE_BITMAP here. cxDesired and cyDesired is the dimensions you want the bitmap to be loaded in, use 0 if you want the bitmap to retain its normal size. fuLoad should be LR_LOADFROMFILE if you want to load from a file, but it can be a combination of other flags as well. The function returns an HBITMAP which you can blit to a surface.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement