Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My application has a graphic window which is used for graphical representation of a component which is to display in a tree. Some times the components are very large in numbers so the graph size is also huge.

In this situation it is difficult for me to see a particular component so I want to add a magnifier window so I can locate some of the particular components in the graph with this magnifier window, just like in Google maps. its just like if you remember when you play age of empire , one small window was there by which we can navigate to any desired area of kingdom.

Any help is greatly appreciated.
Posted
Updated 14-Apr-11 19:38pm
v3
Comments
Slacker007 14-Apr-11 7:13am    
Edited for grammar and spelling.

1 solution

you need the complete picture/screen in a memory bitmap and than deflate it.

I like the code of that article because it is runnung fast: Add fast user-extensible image processing support to CBitmap[^]
 
Share this answer
 
Comments
bitsmax 11-Aug-11 1:54am    
Hello KarstenK,
Thanks for reply.
could you please help me out in getting the bitmap of my view , as i am not able to get the bitmap.
currently i am taking the snapshot of my view and copy it on clipboard, but i ma not getting the image , it showing a dot only .
below is my code .. please have a look


CDC dc;

HDC hdc = ::GetDC(m_WndGraph->m_hWnd);
dc.Attach(hdc);

CDC memDC;
memDC.CreateCompatibleDC(&dc);

CBitmap bm;
CRect r;

m_WndGraph(that is my view)->GetClientRect(&r);

CString s;
m_WndGraph->GetWindowText(s);
CSize sz(r.Width(), r.Height());
bm.CreateCompatibleBitmap(&dc, sz.cx, sz.cy);
CBitmap * oldbm = memDC.SelectObject(&bm);
memDC.BitBlt(0, 0, sz.cx, sz.cy, &dc, 0, 0, SRCCOPY);

m_WndGraph->GetParent()->OpenClipboard();
::EmptyClipboard();
::SetClipboardData(CF_BITMAP, bm.m_hObject);
CloseClipboard();

memDC.SelectObject(oldbm);
KarstenK 11-Aug-11 4:06am    
lives your bm bitmap on the point your are accessing the clipboard?

As debugging point you draw the bm in your view for checking you got your bits ;-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900