Click here to Skip to main content
15,888,733 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Exception problem Pin
Randor 11-Nov-08 17:22
professional Randor 11-Nov-08 17:22 
QuestionHelp in CxImage.. Pin
gothic_coder11-Nov-08 3:13
gothic_coder11-Nov-08 3:13 
AnswerRe: Help in CxImage.. Pin
Hamid_RT11-Nov-08 4:20
Hamid_RT11-Nov-08 4:20 
GeneralRe: Help in CxImage.. Pin
gothic_coder11-Nov-08 4:25
gothic_coder11-Nov-08 4:25 
GeneralRe: Help in CxImage.. Pin
Mark Salsbery11-Nov-08 5:50
Mark Salsbery11-Nov-08 5:50 
GeneralRe: Help in CxImage.. Pin
gothic_coder11-Nov-08 19:24
gothic_coder11-Nov-08 19:24 
GeneralRe: Help in CxImage.. Pin
gothic_coder11-Nov-08 19:38
gothic_coder11-Nov-08 19:38 
GeneralRe: Help in CxImage.. Pin
gothic_coder11-Nov-08 21:35
gothic_coder11-Nov-08 21:35 
Edited..

Now i'm doing something like this.. This should disply PNG on picture control..But no success..

case WM_INITDIALOG:
		{ 
			HBITMAP m_bitmap = NULL;
			CxImage image("E:\\My_Prog\\FINAL_PNG\\Res\\eScan.png", CXIMAGE_FORMAT_PNG);
			
			RECT rect;
			HWND hImage = GetDlgItem(hWnd, IDC_DRAW_IMAGE);
			GetClientRect(hImage, &rect);
			int rectHeight = rect.bottom - rect.top;
			int rectWidth = rect.right - rect.left;

			int height = image.GetHeight();
			int width = image.GetWidth();

			//if height or width larger than image's size, resample it
			//else show image in original size.

			int xpos = 0;
			int ypos = 0;
			if(height > rectHeight || width > rectWidth)
			{
				//
				double ratiox = (double)rectWidth /(double)width;
				double ratioy = (double)rectHeight/(double)height;
				double ratio = ratiox > ratioy? ratioy: ratiox;
				width = width * ratio;
				height = height * ratio;
				image.Resample(width, height);
				image.Save("E:\\My_Prog\\FINAL_PNG\\Res\\eScan.bmp", CXIMAGE_FORMAT_BMP);
			}

			xpos = (rectWidth - width)/2;
			ypos = (rectHeight - height)/2;

			//GetDlgItem(IDC_IMAGE)->GetDC()->FillSolidRect(0, 0, rectWidth, rectHeight, 0x000000);
			HDC hdc = GetDC(hImage);
			image.Draw(hdc, xpos, ypos);

			//if(m_posFile == NULL)
			//	m_posFile = m_pFileList->GetHeadPosition();
			
			break;
		}

GeneralRe: Help in CxImage.. Pin
Mark Salsbery12-Nov-08 6:25
Mark Salsbery12-Nov-08 6:25 
GeneralRe: Help in CxImage.. Pin
CPallini11-Nov-08 21:43
mveCPallini11-Nov-08 21:43 
GeneralRe: Help in CxImage.. Pin
Hamid_RT11-Nov-08 5:54
Hamid_RT11-Nov-08 5:54 
AnswerRe: Help in CxImage.. Pin
Balaram_Neni11-Nov-08 17:14
Balaram_Neni11-Nov-08 17:14 
QuestionHittest is not working when WS_SYSMENU is defined for frame less window PinPopular
tarunclassic11-Nov-08 1:51
tarunclassic11-Nov-08 1:51 
QuestionWrite String Pin
cpvc++11-Nov-08 1:51
cpvc++11-Nov-08 1:51 
QuestionRe: Write String Pin
Roger Stoltz11-Nov-08 2:06
Roger Stoltz11-Nov-08 2:06 
JokeRe: Write String Pin
David Crow11-Nov-08 3:03
David Crow11-Nov-08 3:03 
AnswerRe: Write String Pin
Roger Stoltz11-Nov-08 3:07
Roger Stoltz11-Nov-08 3:07 
JokeRe: Write String Pin
toxcct11-Nov-08 3:52
toxcct11-Nov-08 3:52 
QuestionRe: Write String Pin
CPallini11-Nov-08 2:36
mveCPallini11-Nov-08 2:36 
AnswerRe: Write String Pin
cpvc++11-Nov-08 18:31
cpvc++11-Nov-08 18:31 
GeneralRe: Write String Pin
CPallini11-Nov-08 21:35
mveCPallini11-Nov-08 21:35 
GeneralRe: Write String Pin
cpvc++11-Nov-08 23:41
cpvc++11-Nov-08 23:41 
GeneralRe: Write String Pin
CPallini11-Nov-08 23:49
mveCPallini11-Nov-08 23:49 
GeneralRe: Write String Pin
cpvc++12-Nov-08 18:47
cpvc++12-Nov-08 18:47 
AnswerRe: Write String Pin
rrrado11-Nov-08 4:23
rrrado11-Nov-08 4:23 

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.