|
Hi,
I have two tiff images and I am loading them into CBitmap using GDI Bitmap class. I am using one of the image to paint the background of a dialog and its working fine. Now I would like to use the second image to draw on top of the first. The second image has some transaparent areas and those areas should be replaced with the image in the back( first image).
I tried several examples in Codeproject, But I am getting the transaparent area filled with blue.
Can someone pl. guide me on doing this.
Thanks
San
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Try to create a new view which is
overlapped on the dialogbox.
The first image should be in CStatic
control.
The second image should be manually
drawn on the view by editing the
function OnDraw(CDC* pDC).
This might work but dont know about
the windows message realted to it.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
Maybe you can use TransparentBlt() in NT. This is an easiest way to paint with a transparent color.
|
|
|
|
|
Hi there,
I have an addin to ms Word written in visual c++ implementing the IDTExtensibility2 interface.
I sink events properly and launch my functions...
My question is..how can I call those functions from a different c++ project?(that should be possible)
need I to register them as word native functions, can I use messages to call them?...
thanks and happy codding
AB.
|
|
|
|
|
Hello Friends,
I'm developing an application in which there are few dialog boxes and i decided to make them colourful using bitmaps,So i used the OnEraseBkGnd function to load the bitmaps .but there was an mismatch between the dialog size and bitmap size so i decided to capture the size of the dialog and the bitmap,after which i repainted the dialog calling the BitBlt function many number of times.
Is there anyother way to load the bitmaps so that i dont have to call the BitBlt function more than once.I've attached the piece of code what i'm using now.it'd be great if someone could help me in this...
BOOL dialog::OnEraseBkgnd(CDC* pDC)
{
CBitmap bmp;
CBitmap *ptrBmpOld;
CDC dcMemory;
BITMAP bm;
CRect rect;
int i, j;
int nHor, nVer;
bmp.LoadBitmap(IDB_BITMAP1);
bmp.GetBitmap(&bm);
GetClientRect(rect);
nHor=rect.Width()/bm.bmWidth+1;
nVer=rect.Height()/bm.bmHeight+1;
dcMemory.CreateCompatibleDC(pDC);
ptrBmpOld=dcMemory.SelectObject(&bmp);
for(i=0; i<nhor; i++)
{
for(j="0;" j<nver;="" j++)
{
pdc-="">BitBlt
(
i*bm.bmWidth,
j*bm.bmHeight,
bm.bmWidth,
bm.bmHeight,
&dcMemory,
0,
0,
SRCCOPY
);
}
}
dcMemory.SelectObject(ptrBmpOld);
return TRUE;
}
Rajeev
-- modified at 8:05 Monday 3rd October, 2005
|
|
|
|
|
You could use CStatic objects, to which you set the bitmaps using SetBitmap(HBITMAP hBitmap)
SkyWalker
-- modified at 8:28 Monday 3rd October, 2005
|
|
|
|
|
Hey Rajeev
How ru ?
Just dont use any type of coding .
Put a CStatic control for displaying
the bitmap u want.
This will be more siple .
enjoy
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Yeh ur true Rajeev
As the the OnEraseBkgnd will be oftenly called
if ur going to do BitBlt in that function the
5speed will be slow .
Have u tried to use the same code with OnDraw
member function.
U can aslo try to add the code on WM_INITDIALOG.
take care
send me the feedback when u have dont it.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
how many message maps in MFC
please give me answer.
Thank you CodeProject
|
|
|
|
|
to get an answer, you might ask a correct question...
Santosh Kumar79 wrote:
please give me answer.
please give me a question to answer...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 3:20 Tuesday 4th October, 2005
|
|
|
|
|
Have you looked through MFC's source files?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Pls explain in Detail ???
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Too many.
Search WM_ messages in MSDN you can get your answer
Iman Ghasrfakhri
|
|
|
|
|
3 I guess. 1 for CDialog and 1 for CWnd and 1 for hummm. dont know.
-prakash
|
|
|
|
|
|
Jose Lamas Rios wrote:
42
Hi Jose....how you reach to the fiqure of 42?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
Hi Jose....how you reach to the fiqure of 42?
Probably a bad joke, but since you ask...
I asked Deep Thought, of course!
"I checked it very thoroughly," said the computer, "and that quite definitely is the answer. I think the problem, to be quite honest with you, is that you've never actually known what the question is."
See The Answer to Life, the Universe, and Everything[^]
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
See The Answer to Life, the Universe, and Everything[^]
Great
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Santosh Kumar79 wrote:
how many message maps in MFC
ONE:-
DECLARE_MESSAGE_MAP()
BEGIN_MESSAGE_MAP()
END_MESSAGE_MAP()
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
a great joke as i like to wake up...
well, that worthes a '5' from me
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i want to make the frame of the application in the center
of the screen ,when the application is started. how can i do it?
thank you!
libo
|
|
|
|
|
|
If this is an MFC application, have you considered CenterWindow() ?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|