本文整理汇总了C++中MyImage::getImagePath方法的典型用法代码示例。如果您正苦于以下问题:C++ MyImage::getImagePath方法的具体用法?C++ MyImage::getImagePath怎么用?C++ MyImage::getImagePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyImage
的用法示例。
在下文中一共展示了MyImage::getImagePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProc
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
{
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
// Top Text
char text[1000];
// Image Header setup
BITMAPINFO bmi;
CBitmap bitmap;
memset(&bmi,0,sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
bmi.bmiHeader.biWidth = myImage.getWidth();
bmi.bmiHeader.biHeight = -myImage.getHeight(); // Use negative height. DIB is top-down.
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = myImage.getWidth()*myImage.getHeight();
// Draw Processed image
sprintf(text, "\n %s -> display", myImage.getImagePath());
DrawText(hdc, text, strlen(text), &rt, DT_LEFT);
sprintf(text, "\n %s -> Gray Scaled -> YUV -> DCT -> Quant [ %d ] -> Dequant [ %d ] -> IDCT [ %d Co-Efficient(s) ] ", myImage.getImagePath(), myImage.getQuant(), myImage.getQuant(), myImage.getCoEff());
DrawText(hdc, text, strlen(text), &rt, DT_RIGHT);
// Draw image
SetDIBitsToDevice(hdc,
100,100,myImage.getWidth(),myImage.getHeight(),
0,0,0,myImage.getHeight(),
myImage.getBytesRGBSTART(),&bmi,DIB_RGB_COLORS);
SetDIBitsToDevice(hdc,
300+myImage.getWidth()+50,100,myImage.getWidth(),myImage.getHeight(),
0,0,0,myImage.getHeight(),
myImage.getBytesRGBEND(),&bmi,DIB_RGB_COLORS);
EndPaint(hWnd, &ps);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}