Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
You still need the lib. Headers and libraries have different purposes.
As for other systems: you need at least Win98 or Win2k for AlphaBlend in any case, because that's where msimg32.dll is available. I don't think it would work even if you would install it on older systems though.
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
I guess now the question is, how do I tell the compiler to get AlphaBlend from the other library instead of the one it is apparently trying to pull from?
Originally posted by aewarnick I guess now the question is, how do I tell the compiler to get AlphaBlend from the other library instead of the one it is apparently trying to pull from?
If you are using vc 6, I think you need to download and install the platform sdk, and put the sdk's header and library paths before vc's paths in the vc's setting.
vc 6 's is built for win95, no kidding, even though vc6 and win98 are released at about the same time (1998). I had vc6 sp5 and win98 fe. I tried to use LoadCursor() with IDC_HAND but failed because of the outdated header that came originally with vc, does not define IDC_HAND. (IDC_HAND is only available on Win98/Me and Win2000/XP, according to msdn)
Originally posted by aewarnick I guess now the question is, how do I tell the compiler to get AlphaBlend from the other library instead of the one it is apparently trying to pull from?
Currently it isn't finding it. Just add the library to the import libraries (I think it's the /l switch, but you can look that up by typing
bcc32 /?
) and it should work.
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
One solution is to write your own AlphaBlend code.
I have done that once for my screen saver. I wrote that because I didn't know that is called AlphaBlend and there is a windows api for it. After several attempts, it was unsuccessful but the msdn documented the formula used for alphablend api. I used that and I succeeded.
Anyway, the alphablend api leaks horribly in win 9x OSes.
Attached is my screensaver. Have a look. No need to install. To un-install, just delete the file and its clrblind.dat.
Originally posted by aewarnick I was not afraid you were going to give me a virus.
By making this statement, shows that you had apprehension in the first place.
Originally posted by aewarnick I hoped for the source code but it was not included. Neat screen saver though. Thank you.
I can't give you the source code for the screen saver but I can give you the code for its alphablend. It does not offer so many options as the windows api. I'll give you on the next day because the code is enmeshed in the rendering code of the screen saver; I have to take it out and put it into a function for you. Now is night time over here.
There are several functions you must use to accomplish this.
First function you use, is to convert DDB to DIB
pBGR MyGetDibBits(HDC hdc, HBITMAP hBmp, int nWidth, int nHeight);
In the first call, you pass the hdc and hBmp of the source bmp and its dimension. it will return a pointer of sBGR type(pBGR).
In the second call, you pass the hdc and hBmp of the destination bmp and its dimension. it will return a pointer of sBGR type(pBGR).
The dimensions used in both calls must be the same.
Next you use the AlphaBlend function.
void MyAlphaBlend(pBGR pDest, int nWidth, int nHeight, pBGR pSrc, BYTE Alpha);
Then you use the last function to convert the DIB to DDB,
int MySetDibBits(HDC hdc, HBITMAP hBmp, int nWidth, int nHeight, pBGR buf);
The hdc and hBmp parameters are the ones you will be using to bitblt.
buf is the pDest parameter you feed to MyAlphaBlend()
The return value is the number of scan lines copied.
Now you can bitblt.
Before the program ends, remember to free the 2 pBGR pointers received from the 2 MyGetDibBits()
======================================================
To know more about DIB, you can read 'Windows Programmng' by Charles Petzold. To know more about GetDibBits() and SetDibBits(), you can consult msdn docs.
Here's the attached source, remove the stdafx header if you are not using MFC.