Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need a best possible alternative?? [modified] Pin
Kiran Satish9-Oct-07 6:10
Kiran Satish9-Oct-07 6:10 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery9-Oct-07 8:01
Mark Salsbery9-Oct-07 8:01 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish9-Oct-07 10:49
Kiran Satish9-Oct-07 10:49 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery10-Oct-07 5:24
Mark Salsbery10-Oct-07 5:24 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish10-Oct-07 6:56
Kiran Satish10-Oct-07 6:56 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish11-Oct-07 5:14
Kiran Satish11-Oct-07 5:14 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery11-Oct-07 5:30
Mark Salsbery11-Oct-07 5:30 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish11-Oct-07 12:53
Kiran Satish11-Oct-07 12:53 
At last got it running Big Grin | :-D , removed the text box from the window and bilted it directly onto the dialog box as follows.

void CPSFDlg::OnPaint() <br />
{<br />
CPaintDC dc(this); // device context for painting<br />
HGDIOBJ holdbm;<br />
RECT rect;<br />
BYTE color;<br />
int align_top,align_left;<br />
this->GetClientRect(&rect);<br />
align_top =  (rect.bottom - rect.top - row) / 2;<br />
align_left =  (rect.right - rect.left - col) / 2;<br />
this->InvalidateRect(NULL,TRUE);<br />
RGBTRIPLE *pCurRowPixel = (RGBTRIPLE *)(pDIBSectionBits);<br />
for (int y = 0; y < col; ++y)<br />
{<br />
	for (int x = 0; x < row; ++x)<br />
	{<br />
		color = (BYTE) data[x * col + (row - 1 - y)];<br />
		pCurRowPixel[x].rgbtBlue = color;<br />
		pCurRowPixel[x].rgbtGreen = color;<br />
		pCurRowPixel[x].rgbtRed = color;<br />
	}<br />
	pCurRowPixel = (RGBTRIPLE *)((BYTE*)pCurRowPixel + Stride);<br />
}	<br />
holdbm = memDC.SelectObject(hbm);<br />
dc.BitBlt(align_left, align_top, bmi.bmiHeader.biWidth, bmi.bmiHeader.biHeight,&memDC,0,0,SRCCOPY);<br />
memDC.SelectObject(holdbm);<br />
}


the problem is, the window keeps on refreshing all the time even though there is nothing happening on tht window and you can see the image flickering in it. How to get rid of it??

thanks,

PKNT

GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery11-Oct-07 13:06
Mark Salsbery11-Oct-07 13:06 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish11-Oct-07 13:31
Kiran Satish11-Oct-07 13:31 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery11-Oct-07 13:41
Mark Salsbery11-Oct-07 13:41 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish11-Oct-07 13:46
Kiran Satish11-Oct-07 13:46 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish17-Oct-07 11:09
Kiran Satish17-Oct-07 11:09 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery20-Oct-07 5:31
Mark Salsbery20-Oct-07 5:31 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery2-Oct-07 8:40
Mark Salsbery2-Oct-07 8:40 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery3-Oct-07 12:59
Mark Salsbery3-Oct-07 12:59 
AnswerRe: Need a best possible alternative?? Pin
Nelek27-Sep-07 21:19
protectorNelek27-Sep-07 21:19 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish1-Oct-07 10:46
Kiran Satish1-Oct-07 10:46 
GeneralRe: Need a best possible alternative?? Pin
Nelek2-Oct-07 10:19
protectorNelek2-Oct-07 10:19 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery9-Oct-07 6:04
Mark Salsbery9-Oct-07 6:04 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish18-Jun-08 17:55
Kiran Satish18-Jun-08 17:55 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery19-Jun-08 6:40
Mark Salsbery19-Jun-08 6:40 
QuestionCString to char* leads to an exception Pin
Mike Borozdin27-Sep-07 6:41
Mike Borozdin27-Sep-07 6:41 
QuestionRe: CString to char* leads to an exception Pin
David Crow27-Sep-07 7:20
David Crow27-Sep-07 7:20 
AnswerRe: CString to char* leads to an exception Pin
Mike Borozdin27-Sep-07 7:47
Mike Borozdin27-Sep-07 7:47 

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.