| 106 | } |
| 107 | |
| 108 | void CBriefScreenEdit::UpdateView(void) { |
| 109 | CWnd *objwnd; |
| 110 | RECT rect; |
| 111 | int x, y, w, h; |
| 112 | |
| 113 | objwnd = GetDlgItem(IDC_BRIEF_ADDS_PICTURE); |
| 114 | objwnd->GetWindowRect(&rect); |
| 115 | ScreenToClient(&rect); |
| 116 | |
| 117 | int bmw, bmh; |
| 118 | |
| 119 | Desktop_surf->attach_to_window((unsigned)m_hWnd); |
| 120 | |
| 121 | w = rect.right - rect.left; |
| 122 | h = rect.bottom - rect.top; |
| 123 | |
| 124 | bmw = w; |
| 125 | bmh = h; |
| 126 | |
| 127 | static bool first_call = true; |
| 128 | |
| 129 | if (first_call) |
| 130 | Desktop_surf->clear(rect.left, rect.top, w, h); |
| 131 | |
| 132 | m_ObjectSurf.create(bmw, bmh, BPP_16); |
| 133 | |
| 134 | if (bm_handle > BAD_BITMAP_HANDLE) { |
| 135 | m_ObjectSurf.load(bm_handle); |
| 136 | } else |
| 137 | Desktop_surf->clear(rect.left, rect.top, w, h); |
| 138 | |
| 139 | x = rect.left + (w / 2) - m_ObjectSurf.width() / 2; |
| 140 | y = rect.top + (h / 2) - m_ObjectSurf.height() / 2; |
| 141 | |
| 142 | Desktop_surf->blt(x, y, &m_ObjectSurf); |
| 143 | |
| 144 | m_ObjectSurf.free(); |
| 145 | Desktop_surf->attach_to_window((unsigned)NULL); |
| 146 | |
| 147 | if (first_call) |
| 148 | first_call = false; |
| 149 | } |
| 150 | |
| 151 | void CBriefScreenEdit::OnTimer(UINT nIDEvent) { |
| 152 | UpdateView(); |