|
I wish someone here could help you out, but I suggest you not to *magnify* your question. Remove all those bold style and post a neat question. An example:
Hi Friends,
I have a top level window. I need to show background magnified contents into the window. [Explain a bit more here]
My approach:
I created the desktop bitmap on application startup i.e. m_hbitmapScreenShot.
I created a WS_POPUP window; on each mouse move call i move the window by specified offset calling MoveWindow API and draw the new location contnets into it.
CDC* pDC = GetDC();
CRect rc;
GetClientRect(&ec);
::StretchBlt(pDC->;m_hDC, 0, 0, rc.Width(), rc.Height(), m_hMemDC, nDesX, nDesY, m_nGlassSize /m_nZoomLevel,
m_nGlassSize / m_nZoomLevel, SRCCOPY);
I have two issues
1) When I move the window the background window is not painted at once; so my window traces remains at old location for a while.
2) How to capture background window bitmap when my window is up; I dont need my window in screen shot.
Also, The Other magnified glass disappears as left mouse button is up.
But I need to show it always.
I am attaching screen shot "Magnify.JPG" for your reference.
"Magnify.JPG" location
http://picasaweb.google.com/Smadhukar2000/MFC#5308114585517259826[^]
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
First of all, I agree with VuNic, please don't "run into the room and start yelling 'Look at me, look at me'", using the bolds will just get people upset around here.
And for your problem, try using a Layered window[^] for your "magnifying glass". If you get the desktop DC and use StretchBlt to blit from it you should see that your layered window over the desktop is not in the capture. But note that this works for all layered windows so your screen capture will not show ANY layered windows, not just your own.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello friends:
I want to capture a minimized window in win2000.I search google and many developer use the "printwindow" function to do it.But the problem is that I use win2000 and VC++6. How to do it? I try to copy winspool.dll and user32.dll to win2000 from windowsXP,But it doesn't work
Please help!
|
|
|
|
|
And why it doesnt work?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I don't know.Maybe it use other windowsXP's dll? I copy user32.dll from winxp to win2000 and it don't work too.
|
|
|
|
|
PrintWindow is not supported in Win2K.
It is not enough to simply copy some DLLs from XP to make this work in Win2K.
I'm sure the call goes down to the kernel and calls some routines there.
So you will have to implement this the hard way without the PrintWindow function.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I have a problem with EAXDirectSoundCreate method call. If I created a DLL which uses MFC, and in the DLL's InitInstance() to revoke EAXDirectSoundCreate. When application runs, and loads the DLL, then EAXDirectSoundCreate executed, application will hang up inside of that method. Need your help here how to fix the problem. Thanks.
|
|
|
|
|
How do we build a network using visual c++..The network is assumed as graph.
|
|
|
|
|
We usually build networks using cables, hubs, switches,...
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
We also use of a Repeaters and A network card.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I should admit you're more advanced.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No, you must have asked her to search for VC++ in Orkut, FaceBook ,etc. That's what the OP is looking for.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I should admit, you're more advanced too: How do you know the OP is a lady?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You are right, no clue but I don't know why called the OP as she. lol Anyway let her clarify that one
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
She !!! it looks you forgot me,yes?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
No. Yes. No. Yes . lol Now I wont forget you anymore
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
of course you are first.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Have a look at the boost graph library. For quidance try ISBN 0-201-72914-8: The boost graph library user guide and reference manual; I recommend it.
|
|
|
|
|
Hi,
Has anyone come across a simple way of making an MFC toolbar button flash? I tried using pCmdUI->Enable() with an alternating enable/disable flag which looked great but of course the button is disabled half the time
TIA
Tony
|
|
|
|
|
How about alternating checked/unchecked?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Thanks for the suggestion. I tried it and it looked OK but still not quite what I wanted. For info, I did manage to get the look I was after but I dont know if its the "correct" way to do it. I created two versions of the toolbar bitmap each showing the two states I needed. I loaded them into two image lists in CMainFrame::OnCreate(). I then swapped the image list into the toolbar on a timer, like this...
CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
m_il1.Create(IDR_MAINFRAME1, 32, 0,RGB(128,128,128));
m_il2.Create(IDR_MAINFRAME2, 32, 0,RGB(128,128,128));
...
}
CMainFrame::FlashToolbarButton()
{
static bool bSwap = true;
if(bSwap)
{
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_il1);
bSwap = FALSE;
}
else
{
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_il2);
bSwap = TRUE;
}
m_wndToolBar.Invalidate();
}
Probably very ugly - maybe someone else has a more elegant solution.
|
|
|
|
|
How about an owner drawn toolbar[^]?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
The code below produces the following compiling error:
STS_OP_temp_test.cpp: In constructor 'STS_OP_temp_test<U>::STS_OP_temp_test()':
STS_OP_temp_test.cpp:66: error: expected primary-expression before 'int'
STS_OP_temp_test.cpp:66: error: expected `;' before 'int'
I take the error to mean that the compiler can't resolve "cwtm.templateMethod". Either it doesn't think "cwtm" is defined, or it doesn't think cwtm has a method called "templateMethod".
If you don't quite understand the class template stuff happening here, go to this site:
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/template_template_arguments.htm
But that site doesn't solve my problem.
Thanks for your help.
#ifndef STS_OP_temp_test_HPP
#define STS_OP_temp_test_HPP
#include <typeinfo>
#include <iostream>
#include <string>
//------------------------------------------------------------------------------
template <typename T = int>
class Class_with_template_method
{
public:
//--------------------------------------------------------------------------
Class_with_template_method()
{}
//--------------------------------------------------------------------------
template <typename P>
void templateMethod()
{
std::cout << "Method template is of type: " << typeid(P).name() << std::endl;
}
};
//------------------------------------------------------------------------------
template <template<class T> class U>
class STS_OP_temp_test
{
public:
//--------------------------------------------------------------------------
STS_OP_temp_test()
{
cwtm.templateMethod<int>(); // Line 66 compiling error!!!
real_cwtm.templateMethod<int>();
}
U<int> cwtm;
Class_with_template_method<> real_cwtm;
};
int main()
{
STS_OP_temp_test<Class_with_template_method> C();//*/
return (1);
}
#endif
<div class="ForumMod">modified on Saturday, February 28, 2009 1:21 PM</div>
|
|
|
|
|
I've done some more testing and uncovered something interesting. The template method being called will work if the template parameter is not explicitly specified.
See the addtional method added to Class_with_template_method, "templatePassedIn". And the modified STS_OP_temp_test constructor.
#ifndef STS_OP_temp_test_HPP
#define STS_OP_temp_test_HPP
#include <typeinfo>
#include <iostream>
#include <string>
//------------------------------------------------------------------------------
template <typename T = int>
class Class_with_template_method
{
public:
//--------------------------------------------------------------------------
Class_with_template_method()
{}
//--------------------------------------------------------------------------
template <typename P>
void templateMethod()
{
std::cout << "Method template is of type: " << typeid(P).name() << std::endl;
}
//--------------------------------------------------------------------------
template <typename D>
void templatePassedIn(D p_passed)
{
std::cout << "Method template is of type: " << typeid(D).name() << std::endl
<< "And has value: " << p_passed << std::endl;
}
};
//------------------------------------------------------------------------------
template <template<typename> class U = Class_with_template_method >
class STS_OP_temp_test
{
public:
//--------------------------------------------------------------------------
STS_OP_temp_test()
{
cwtm.templatePassedIn(6); // works
cwtm.templatePassedIn<int>(6); // ERROR !!!
cwtm.templateMethod<int>(); // ERROR !!!
//------------------------------------------------------------------------------
real_cwtm.templateMethod<int>(); // works
real_cwtm.templatePassedIn(6); // works
real_cwtm.templatePassedIn<int>(6); // works
}
U<int> cwtm; // Care about template type
Class_with_template_method<> real_cwtm;
};
int main()
{
STS_OP_temp_test<> B();
return (1);
}
#endif
<div class="ForumMod">modified on Saturday, February 28, 2009 1:58 PM</div>
|
|
|
|
|
It's because there's no way for the compiler to tell when it's doing syntax checking that U<int>.templateMethod is a template function. So, you have to tell it, like so:
cwtm.template templateMethod<int>();
This compiles OK with gcc 4.0.1.
Interestingly, VC++9.0 doesn't care either way - it's happy to compile your original code or the variant with template added in.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|