How can we get pictures in Mainframe
-
Hi all, how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,, thanks in advance, Saravana...
-
Hi all, how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,, thanks in advance, Saravana...
saravana001 wrote:
how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,,
how are putting you image in MainFrame Window, i.e. View Window. have you overidden the OnDraw function for drawing image on View Window. you can use this class for display variety of image format on windows http://www.codeproject.com/bitmap/extendedbitmap2.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Hi all, how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,, thanks in advance, Saravana...
I have an MDI app - and I wanted a less boring backdrop. The trick is to subclass the MDI Frame window - and then override WM_ERASEBKGND. The below code uses CSubclassWnd by Paul DiLascia - you should be able to search for in from an old MSJ article on the web. Good luck, Iain.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_Backdrop.Install (m_hWndMDIClient, IDB_MIDAS, 32);
....
return 0;
}class CUIMDIBackdrop : public CSubclassWnd
{
public:
CUIMDIBackdrop ();
~CUIMDIBackdrop ();
BOOL Install (HWND hWndMDIClient, UINT idBitmap, int nMargin);protected:
virtual LRESULT WindowProc(UINT msg, WPARAM wp, LPARAM lp);
};CUIMDIBackdrop::CUIMDIBackdrop ()
{
}CUIMDIBackdrop::~CUIMDIBackdrop ()
{
}BOOL CUIMDIBackdrop::Install (HWND hWndMDIClient, UINT idBitmap, int nMargin)
{
// load resources and other graphics stuff here
return HookWindow (hWndMDIClient);
}LRESULT CUIMDIBackdrop::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
{
if (msg != WM_ERASEBKGND)
return CSubclassWnd::WindowProc(msg, wp, lp);HDC hDC = (HDC) wp; CDC \*pDC = CDC::FromHandle (hDC); CRect rc; ::GetClientRect (m\_hWnd, &rc); // do pretty stuff here return TRUE;
}