Click here to Skip to main content
15,914,943 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionflowing strings on BMP image of SDI View window? Pin
rambojanggoon12-Aug-09 21:39
rambojanggoon12-Aug-09 21:39 
AnswerRe: flowing strings on BMP image of SDI View window? Pin
KarstenK12-Aug-09 22:04
mveKarstenK12-Aug-09 22:04 
Questionhow to display many picture in 1 dialog Pin
DevelopmentNoob12-Aug-09 19:32
DevelopmentNoob12-Aug-09 19:32 
AnswerRe: how to display many picture in 1 dialog Pin
DevelopmentNoob12-Aug-09 19:42
DevelopmentNoob12-Aug-09 19:42 
GeneralRe: how to display many picture in 1 dialog Pin
Code-o-mat12-Aug-09 21:27
Code-o-mat12-Aug-09 21:27 
GeneralRe: how to display many picture in 1 dialog Pin
DevelopmentNoob12-Aug-09 23:45
DevelopmentNoob12-Aug-09 23:45 
GeneralRe: how to display many picture in 1 dialog Pin
Code-o-mat13-Aug-09 0:08
Code-o-mat13-Aug-09 0:08 
GeneralRe: how to display many picture in 1 dialog [modified] Pin
DevelopmentNoob13-Aug-09 15:24
DevelopmentNoob13-Aug-09 15:24 
hi,below is my partially code.

void CTest::OnRadioDirection(UINT nID)
{

	switch(nID)
	{
	case IDC_1:								  
		id = 0;
		break;
	case IDC_2:
		id = 1;
		break;
	case IDC_3:
		id = 2;
		break;
	case IDC_4:
		id = 3;
	default:
		break;
	}
	m_pGUIDoc->UpdateAllViews(NULL);
}


void CTest::DrawPreview(CDC* pDC)
{
	if (m_pImg[id])            //m_pImg is a IplImage,can say is a image
	{                          //the id is the no of the radio button,
//eg,button 1 = id = 0,button 2 = id =1 
		BYTE* pImg = (BYTE*)m_pImg[id]->imageData;
		CvSize size = cvGetSize(m_pImg[id]);
		CRect rcPreview;
		if (id == 0)
			GetDlgItem(IDC_picture1)->GetWindowRect(&rcPreview);
		else if (id == 1)
			GetDlgItem(IDC_PICTURE2)->GetWindowRect(&rcPreview);
		else if (id == 2)
			GetDlgItem(IDC_PICTURE3)->GetWindowRect(&rcPreview);
		else if (id == 3)
			GetDlgItem(IDC_PICTURE4)->GetWindowRect(&rcPreview);
		else
			;

		ScreenToClient(&rcPreview);
	
		double scaleX = (double)size.width / (double)rcPreview.Width();
		double scaleY = (double)size.height / (double)rcPreview.Height();
		double scaleToFit = (scaleX > scaleY) ? scaleX : scaleY;
		int iWidth = (int) ((double)size.width / scaleToFit);
		int iHeight = (int) ((double)size.height / scaleToFit);
		int iOffX = rcPreview.left;
		int iOffY = rcPreview.top;

		HDC hDC = pDC>GetSafeHdc();
		SetStretchBltMode(hDC, COLORONCOLOR);
		StretchDIBits(hDC, iOffX, iOffY, iWidth, iHeight, 
			0, 0, size.width, size.height, pImg, GetBitmapTag(), DIB_RGB_COLORS, SRCCOPY);
	}
}


The program is using the opencv to do the image processing.

modified on Thursday, August 13, 2009 10:14 PM

GeneralRe: how to display many picture in 1 dialog Pin
Code-o-mat13-Aug-09 20:59
Code-o-mat13-Aug-09 20:59 
GeneralRe: how to display many picture in 1 dialog Pin
DevelopmentNoob13-Aug-09 21:22
DevelopmentNoob13-Aug-09 21:22 
GeneralRe: how to display many picture in 1 dialog Pin
Code-o-mat13-Aug-09 21:43
Code-o-mat13-Aug-09 21:43 
GeneralRe: how to display many picture in 1 dialog Pin
DevelopmentNoob13-Aug-09 22:35
DevelopmentNoob13-Aug-09 22:35 
GeneralRe: how to display many picture in 1 dialog Pin
Code-o-mat13-Aug-09 22:39
Code-o-mat13-Aug-09 22:39 
AnswerRe: how to display many picture in 1 dialog Pin
CPallini12-Aug-09 21:03
mveCPallini12-Aug-09 21:03 
QuestionComboBox Pin
kumar sanghvi12-Aug-09 19:25
kumar sanghvi12-Aug-09 19:25 
AnswerRe: ComboBox Pin
Bacon Ultimate Cheeseburger12-Aug-09 19:51
Bacon Ultimate Cheeseburger12-Aug-09 19:51 
GeneralRe: ComboBox Pin
kumar sanghvi12-Aug-09 19:59
kumar sanghvi12-Aug-09 19:59 
GeneralRe: ComboBox Pin
Bacon Ultimate Cheeseburger12-Aug-09 20:26
Bacon Ultimate Cheeseburger12-Aug-09 20:26 
GeneralRe: ComboBox Pin
kumar sanghvi13-Aug-09 21:49
kumar sanghvi13-Aug-09 21:49 
QuestionHow i can insert image on Bitmap Pin
002comp12-Aug-09 19:00
002comp12-Aug-09 19:00 
AnswerRe: How i can insert image on Bitmap Pin
Joe Woodbury12-Aug-09 19:22
professionalJoe Woodbury12-Aug-09 19:22 
GeneralRe: How i can insert image on Bitmap Pin
002comp12-Aug-09 19:55
002comp12-Aug-09 19:55 
Questioncheck whether new picture upload in the folder Pin
pearllyn12-Aug-09 15:15
pearllyn12-Aug-09 15:15 
AnswerRe: check whether new picture upload in the folder Pin
zhu_lin12-Aug-09 15:54
zhu_lin12-Aug-09 15:54 
GeneralRe: check whether new picture upload in the folder Pin
pearllyn12-Aug-09 16:35
pearllyn12-Aug-09 16:35 

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.