123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #include "stdafx.h"
- #include "dbserver.h"
- #include "ShowPhoto.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- ShowPhoto::ShowPhoto(CWnd* pParent )
- : CDialog(ShowPhoto::IDD, pParent)
- {
-
-
-
- }
- void ShowPhoto::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
-
-
- }
- BEGIN_MESSAGE_MAP(ShowPhoto, CDialog)
-
- ON_WM_PAINT()
-
- END_MESSAGE_MAP()
- BOOL ShowPhoto::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
-
- CRect rc;
- HWND wnd = ::FindWindow("Shell_TrayWnd", 0);
- ::GetWindowRect (wnd, &rc);
- int hei=rc.Height ();
- DEVMODE g_dm;
- g_dm.dmSize = sizeof(DEVMODE) ;
- EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&g_dm);
-
- rc=CRect(0,0,g_dm.dmPelsWidth,g_dm.dmPelsHeight-hei);
- MoveWindow(rc);
- return TRUE;
-
- }
- extern void RectFitDes(int width, int height, CRect &rc);
- void ShowPhoto::OnPaint()
- {
- CPaintDC dc(this);
-
-
- if(m_pImg)
- {
- CRect rc;
- GetClientRect(rc);
- RectFitDes(m_pImg->GetWidth(), m_pImg->GetHeight(), rc);
- Graphics dcgraph(dc.GetSafeHdc());
- Rect destinationRect(rc.left , rc.top , rc.Width (), rc.Height ());
- dcgraph.DrawImage(m_pImg, destinationRect, 0,0,m_pImg->GetWidth(), m_pImg->GetHeight(),UnitPixel);
- }
-
- }
|