|
what do you mena by OP code
|
|
|
|
|
The (long) code snippet of the original post.
You may also repost it, correctly formatted, of course.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Have you used the debugger to single-step through the code to find the offending statement(s)?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Comment #1: Try to remove "magic numbers" in the code.
Comment #2: check_name is intialized with how many values?
What happens in the following code if, by some chance, check_name[n] is a character string longer than 11?
char check_name[12][5];
char pns_name[12];
sprintf(pns_name, "%s.PNS", check_name[n]);
Comment #3: Walk through code in the debugger. Use small numbers.
|
|
|
|
|
I am drawing a bitmap on dc using loadImage() and bitblt method
it is working fine. but my problem is that I cannot change the alpha
values of the image i.e. from 0 - 255
Trioum
|
|
|
|
|
AlphaBlend () API can be used.
Come online at:-
jubinc@skype
|
|
|
|
|
but it works with 32bit bitmap I am working with 24 bit.
Trioum
|
|
|
|
|
AFAIK 24 bit bitmaps have not an alpha channel, Am I wrong?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Sorry for quering .I am reviewing my question again actually
I want to set the transparency of the bitmap i.e. from (0-255).
Trioum
|
|
|
|
|
How are you displaying your bitmap ? And what do you need to do exactly ? Do you only need to have some parts of your bitmap transparent ? If yes, take a look at TransparentBlt[^]
|
|
|
|
|
No transparent blt transparent some part. I want the whole image
Trioum
|
|
|
|
|
Why you can't use 32-bit ones?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Did you try with CImage::AlphaBlend ?
|
|
|
|
|
Do you want to actually alter the bitmap pixel data or
just draw the bitmap with adjustable transparency?
To draw with transparency, you can use AlphaBlend(). The
bitmap does NOT have to be 32-bit, but you need to initialize
the BLENDFUNCTION properly:
BLENDFUNCTION blendfunc;
blendfunc.BlendOp = AC_SRC_OVER;
blendfunc.BlendFlags = 0;
blendfunc.SourceConstantAlpha = 40;
blendfunc.AlphaFormat = 0;
To change the pixel data, load it as a DIBSection and loop through the pixel data
applying alpha to each pixel's data.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yes I want that stuff you are right . but when I am using it
BLENDFUNCTION *blendfunc;
blendfunc.BlendOp = AC_SRC_OVER;
blendfunc.BlendFlags = 0;
blendfunc.SourceConstantAlpha = 40; // Set your transparency (0-255) here!blendfunc.AlphaFormat = 0; //Don't use AC_SRC_ALPHA for 24-bit images - there is NO source alpha data
AlphaBlend(m_DC,0,0,720,576,memDC,0,0,100,100,blendfunc);
where 100 100 is height and width of image
error fires call of non function
Trioum
|
|
|
|
|
blendfunc should NOT be a pointer.
BLENDFUNCTION blendfunc;
blendfunc.BlendOp = AC_SRC_OVER;
blendfunc.BlendFlags = 0;
blendfunc.SourceConstantAlpha = 40;
AlphaFormat = 0;
AlphaBlend(m_DC,0,0,720,576,memDC,0,0,100,100,blendfunc);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
On the AlphaBlend() line?
If so, you may need to define WINVER to something >= 0x0400.
This needs to be before any windows or MFC #included header
files.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You can use of CImage class and use of SetPixelRGB.
|
|
|
|
|
Solve It .Actually I am using plan SDK .I cannot use CImage.
thanks Marks
Trioum
|
|
|
|
|
i have splitter control and there are some items in the control. now i have added a new menu item. created a dialog and the base class is CFormView class. now when i am trying to open this dialog with the menu item its giving me an assertion error. it comes to this line in CFormView.cpp
<br />
if (!_AfxCheckDialogTemplate(m_lpszTemplateName, TRUE))<br />
{<br />
ASSERT(FALSE);
PostNcDestroy();
return FALSE;<br />
}<br />
#endif //_DEBUG<br />
<br />
have given the right IDD for the dialog box. what can be the problem?<br />
<br />
|
|
|
|
|
Debug more into _AfxCheckDialogTemplate
Come online at:-
jubinc@skype
|
|
|
|
|
Please check the Dialog associated with the Resource ID preexist. If the Dialog is there, you shouldn't get any error.
|
|
|
|
|
Hi all,
I have a project with few functions. There is no dependencies on each other. I want to execute them on command line parameters. Just like this,
If I type "func 1" on command line, then the first function should be run. How can I approach it.
I appreciate your help all the time...
Eranga
|
|
|
|
|
First hold the strings of all the function names that can be passed as command line. Upon receiving the command line, compare it with the available strings. Based on the result, call the corresponding function.
Come online at:-
jubinc@skype
|
|
|
|