Home > Software engineering >  Ask why can't open BMP images? !
Ask why can't open BMP images? !

Time:11-23

CodePudding user response:

What do you mean? You are loaded from an external file. BMP image? LoadBitmap (), CImage: : the Load ()

CodePudding user response:

The general operation, load open the image in the DOC, in the VIEW of map
 
#include

The class CSDI1Doc: public CDocument
{
Public:
CImage m_Image;
Virtual BOOL OnOpenDocument (LPCTSTR lpszPathName)
{
if (! CDocument: : OnOpenDocument (lpszPathName))
return FALSE;

//load the picture
M_Image. Destroy ();
If (m_Image. Load (lpszPathName)!=S_OK)
return FALSE;

Return TRUE;
}
.
};

//CSDI1View map
Void CSDI1View: : ontouch * pDC (CDC)
{
CSDI1Doc * pDoc=GetDocument ();
ASSERT_VALID (pDoc);
if (! PDoc)
return;

//draw
if(! PDoc - & gt; M_Image. The IsNull ())
{
CRect rc;
GetClientRect (& amp; Rc);
PDoc - & gt; M_Image. The Draw (pDC - & gt; M_hDC, rc);
}
}


CodePudding user response:

Can try the opencv, very convenient

CodePudding user response:

Is put inside the DOC, put out the code

CodePudding user response:

I don't know what are you talking about
  • Related