| 307 | } |
| 308 | |
| 309 | void ImageViewerOnLoad(NetRequest* pRequest) |
| 310 | { |
| 311 | if (pRequest->result != HTTP_OK) |
| 312 | { |
| 313 | DownloadOnRequestFail(g_ivHwnd, pRequest); |
| 314 | KillImageViewer(); |
| 315 | return; |
| 316 | } |
| 317 | |
| 318 | // Since the response is passed in as a string, this could do for getting the binary stuff out of it |
| 319 | const uint8_t* pData = (const uint8_t*)pRequest->response.data(); |
| 320 | const size_t nSize = pRequest->response.size(); |
| 321 | |
| 322 | KillImageBitmaps(); |
| 323 | |
| 324 | bool unusedHasAlpha1 = false; |
| 325 | bool unusedHasAlpha2 = false; |
| 326 | HImage* imFull = ImageLoader::ConvertToBitmap(pData, nSize, unusedHasAlpha1, false, 0, 0); |
| 327 | HImage* imPreview = ImageLoader::ConvertToBitmap(pData, nSize, unusedHasAlpha2, false, g_ivPreviewImageWidth, g_ivPreviewImageHeight); |
| 328 | |
| 329 | g_hBitmapFull = imFull; |
| 330 | g_hBitmapPreview = imPreview; |
| 331 | |
| 332 | g_bChildZoomedIn = false; |
| 333 | SendMessage(g_ivChildHwnd, WM_UPDATEBITMAP, 0, 0); |
| 334 | } |
| 335 | |
| 336 | void ImageViewerRequestSave() |
| 337 | { |
no test coverage detected