Click here to Skip to main content
15,905,068 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Redirect Output in Edit Box in VC++ Pin
Rajkumar R15-Feb-08 21:18
Rajkumar R15-Feb-08 21:18 
GeneralRe: Redirect Output in Edit Box in VC++ Pin
Rajesh R Subramanian15-Feb-08 21:37
professionalRajesh R Subramanian15-Feb-08 21:37 
GeneralRe: Redirect Output in Edit Box in VC++ Pin
queshangxintou15-Feb-08 21:45
queshangxintou15-Feb-08 21:45 
GeneralRe: Redirect Output in Edit Box in VC++ Pin
Hamid_RT18-Feb-08 7:36
Hamid_RT18-Feb-08 7:36 
GeneralFile access optimization Pin
alex.barylski15-Feb-08 19:26
alex.barylski15-Feb-08 19:26 
Questionhow to add library "advapi32.lib" in settings Pin
guru moorthy.k15-Feb-08 19:25
guru moorthy.k15-Feb-08 19:25 
AnswerRe: how to add library "advapi32.lib" in settings Pin
Cedric Moonen15-Feb-08 21:56
Cedric Moonen15-Feb-08 21:56 
GeneralDifference between CPaintDC and CClientDC Pin
Girish Kumar15-Feb-08 18:54
Girish Kumar15-Feb-08 18:54 
difference between CPaintDC and CClientDC:i am using MFC for this application
when i am using CClientDC pdc(this),i am able get my image (video)fully (SIF)
but when i use CCpaintDC pdc(this);i am getting the image size less than SIF.
also in the first case m getting some garbage data also at right end along wid image

<br />
#define RESW 384<br />
#define RESH 240<br />
<br />
#define STWID 140<br />
#define STHT 50<br />
<br />
int m_nStretchWidth = 0;<br />
int m_nStretchHeight = 0;<br />
<br />
UCHAR* thisImage = (UCHAR*) video_outbuf1; <br />
<br />
CRgn updatergn;<br />
updatergn.CreateRectRgn(0, 0, 320+STWID, 240+STHT);<br />
InvalidateRgn(&updatergn, FALSE);<br />
<br />
try<br />
{<br />
m_oImageInfo = new BITMAPINFO;<br />
<br />
m_oImageInfo->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);<br />
m_oImageInfo->bmiHeader.biWidth = RESW;<br />
m_oImageInfo->bmiHeader.biHeight = -RESH;<br />
m_oImageInfo->bmiHeader.biPlanes = 1;<br />
m_oImageInfo->bmiHeader.biBitCount = 24; <br />
m_oImageInfo->bmiHeader.biCompression = BI_RGB;<br />
m_oImageInfo->bmiHeader.biSizeImage = RESW* RESH* 3;//0;<br />
//m_oImageInfo->bmiHeader.biXPelsPerMeter = 0;<br />
//m_oImageInfo->bmiHeader.biYPelsPerMeter = 0;<br />
//m_oImageInfo->bmiHeader.biClrUsed = 0;<br />
//m_oImageInfo->bmiHeader.biClrImportant = 0;<br />
<br />
LPBITMAPINFO poImageInfo = (LPBITMAPINFO)m_oImageInfo; <br />
<br />
CClientDC pdc(this);//CPaintDC pdc(this)<br />
<br />
if ((poImageInfo != NULL) && (thisImage != NULL))<br />
{<br />
int nHorz = poImageInfo->bmiHeader.biHeight;<br />
int nVert = poImageInfo->bmiHeader.biWidth; <br />
if( nHorz == 240 && nVert == 640 )<br />
{<br />
m_nStretchWidth = 640;<br />
m_nStretchHeight = 480;<br />
}<br />
else if( nHorz == 288 && nVert == 704 )<br />
{<br />
m_nStretchWidth = 768;<br />
m_nStretchHeight = 576;<br />
}<br />
else<br />
{<br />
m_nStretchWidth = poImageInfo->bmiHeader.biWidth;<br />
m_nStretchHeight = poImageInfo->bmiHeader.biHeight;<br />
}<br />
<br />
<br />
SetStretchBltMode(pdc.m_hDC,3);<br />
<br />
if(pdc && pdc.m_hDC)<br />
{<br />
int rc = ::StretchDIBits(pdc.m_hDC,<br />
STWID,<br />
STHT, //poImageInfo->bmiHeader.biHeight,<br />
m_nStretchWidth, //poImageInfo->bmiHeader.biWidth, <br />
-m_nStretchHeight, //-poImageInfo->bmiHeader.biHeight, <br />
0, <br />
0, <br />
poImageInfo->bmiHeader.biWidth, <br />
-poImageInfo->bmiHeader.biHeight,<br />
thisImage, <br />
poImageInfo, <br />
DIB_RGB_COLORS, <br />
SRCCOPY); <br />
<br />
}<br />
<br />
}<br />
}<br />
catch(...)<br />
{<br />
AfxMessageBox("Exception in CTestDlg::OnRenderMessage");<br />
}<br />
<br />
<br />
delete(m_oImageInfo);<br />


Girish

GeneralRe: Difference between CPaintDC and CClientDC Pin
Mark Salsbery17-Feb-08 8:58
Mark Salsbery17-Feb-08 8:58 
GeneralRe: Difference between CPaintDC and CClientDC Pin
Hamid_RT18-Feb-08 7:41
Hamid_RT18-Feb-08 7:41 
GeneralMessage Removed Pin
15-Feb-08 18:50
Armond Sarkisian15-Feb-08 18:50 
GeneralRe: Searching for a file... [modified] Pin
Rajkumar R15-Feb-08 21:51
Rajkumar R15-Feb-08 21:51 
GeneralRe: Searching for a file... Pin
Rajesh R Subramanian15-Feb-08 21:59
professionalRajesh R Subramanian15-Feb-08 21:59 
GeneralRe: Searching for a file... Pin
Rajkumar R15-Feb-08 22:02
Rajkumar R15-Feb-08 22:02 
Generalcomparison problem Pin
gentleguy15-Feb-08 17:09
gentleguy15-Feb-08 17:09 
QuestionRe: comparison problem Pin
Rajkumar R15-Feb-08 20:39
Rajkumar R15-Feb-08 20:39 
GeneralRe: comparison problem Pin
gentleguy15-Feb-08 23:19
gentleguy15-Feb-08 23:19 
GeneralRe: comparison problem Pin
Rajkumar R16-Feb-08 7:47
Rajkumar R16-Feb-08 7:47 
QuestionInvoking a .NET 2.0 class from VC++7.1 via COM - compatibility issue? Pin
jjoshua15-Feb-08 14:47
jjoshua15-Feb-08 14:47 
AnswerRe: Invoking a .NET 2.0 class from VC++7.1 via COM - compatibility issue? Pin
jjoshua19-Feb-08 4:17
jjoshua19-Feb-08 4:17 
GeneralUsing MS Mask Edit Control Pin
dipuks15-Feb-08 11:43
dipuks15-Feb-08 11:43 
GeneralRe: Using MS Mask Edit Control Pin
Joan M15-Feb-08 21:31
professionalJoan M15-Feb-08 21:31 
GeneralMFC regular DLL using shared MFC DLL module definition file (.def) question Pin
alchong15-Feb-08 8:49
alchong15-Feb-08 8:49 
GeneralRe: MFC regular DLL using shared MFC DLL module definition file (.def) question Pin
Mark Salsbery15-Feb-08 9:26
Mark Salsbery15-Feb-08 9:26 
GeneralRe: MFC regular DLL using shared MFC DLL module definition file (.def) question Pin
led mike15-Feb-08 11:33
led mike15-Feb-08 11:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.