https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3926e9b3c884e00328ca3…
commit 3926e9b3c884e00328ca38285d5047be5dc4b343
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Apr 20 21:05:14 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Apr 20 21:05:14 2020 +0900
[SHIMGVW] Consider failure case of loading file (#2606)
If loading an image file failed, then properly handle it. The command line is rundll32
shimgvw.dll,ImageView_Fullscreen .
CORE-16911
---
dll/win32/shimgvw/lang/bg-BG.rc | 1 +
dll/win32/shimgvw/lang/cs-CZ.rc | 1 +
dll/win32/shimgvw/lang/de-DE.rc | 1 +
dll/win32/shimgvw/lang/en-US.rc | 1 +
dll/win32/shimgvw/lang/es-ES.rc | 1 +
dll/win32/shimgvw/lang/fr-FR.rc | 1 +
dll/win32/shimgvw/lang/he-IL.rc | 1 +
dll/win32/shimgvw/lang/it-IT.rc | 1 +
dll/win32/shimgvw/lang/ja-JP.rc | 1 +
dll/win32/shimgvw/lang/lt-LT.rc | 1 +
dll/win32/shimgvw/lang/no-NO.rc | 1 +
dll/win32/shimgvw/lang/pl-PL.rc | 1 +
dll/win32/shimgvw/lang/pt-PT.rc | 1 +
dll/win32/shimgvw/lang/ro-RO.rc | 1 +
dll/win32/shimgvw/lang/ru-RU.rc | 1 +
dll/win32/shimgvw/lang/sk-SK.rc | 1 +
dll/win32/shimgvw/lang/sq-AL.rc | 1 +
dll/win32/shimgvw/lang/tr-TR.rc | 1 +
dll/win32/shimgvw/lang/uk-UA.rc | 1 +
dll/win32/shimgvw/lang/zh-CN.rc | 1 +
dll/win32/shimgvw/lang/zh-TW.rc | 1 +
dll/win32/shimgvw/resource.h | 1 +
dll/win32/shimgvw/shimgvw.c | 130 ++++++++++++++++++++++++++++------------
23 files changed, 115 insertions(+), 37 deletions(-)
diff --git a/dll/win32/shimgvw/lang/bg-BG.rc b/dll/win32/shimgvw/lang/bg-BG.rc
index f0e819325bb..91e1f3c8c84 100644
--- a/dll/win32/shimgvw/lang/bg-BG.rc
+++ b/dll/win32/shimgvw/lang/bg-BG.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Прегледът за снимки и факсове на РеактОС"
IDS_SETASDESKBG "Слагане като подкраска"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Преглед"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Следващо изображение"
diff --git a/dll/win32/shimgvw/lang/cs-CZ.rc b/dll/win32/shimgvw/lang/cs-CZ.rc
index 4163698a7b6..f9355e39ba9 100644
--- a/dll/win32/shimgvw/lang/cs-CZ.rc
+++ b/dll/win32/shimgvw/lang/cs-CZ.rc
@@ -9,6 +9,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS prohlížeč obrázků a faxů"
IDS_SETASDESKBG "Nastavit jako pozadí plochy"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Náhled"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Další obrázek"
diff --git a/dll/win32/shimgvw/lang/de-DE.rc b/dll/win32/shimgvw/lang/de-DE.rc
index e199106ac47..ed9b19c6701 100644
--- a/dll/win32/shimgvw/lang/de-DE.rc
+++ b/dll/win32/shimgvw/lang/de-DE.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS-Bild- und Faxansicht"
IDS_SETASDESKBG "Als Desktophintergrund setzen"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Vorschau"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Nächstes Bild"
diff --git a/dll/win32/shimgvw/lang/en-US.rc b/dll/win32/shimgvw/lang/en-US.rc
index 6b7342bad1f..c212b2e7d00 100644
--- a/dll/win32/shimgvw/lang/en-US.rc
+++ b/dll/win32/shimgvw/lang/en-US.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS Picture and Fax Viewer"
IDS_SETASDESKBG "Set as Desktop Background"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Preview"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Next Picture"
diff --git a/dll/win32/shimgvw/lang/es-ES.rc b/dll/win32/shimgvw/lang/es-ES.rc
index 54cc7ed890d..4fd16a4a595 100644
--- a/dll/win32/shimgvw/lang/es-ES.rc
+++ b/dll/win32/shimgvw/lang/es-ES.rc
@@ -6,6 +6,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Visor de imágenes y fax de ReactOS"
IDS_SETASDESKBG "Establecer como fondo de escritorio"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Vista previa"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Siguiente imagen"
diff --git a/dll/win32/shimgvw/lang/fr-FR.rc b/dll/win32/shimgvw/lang/fr-FR.rc
index e020c1ea319..6c7862600b1 100644
--- a/dll/win32/shimgvw/lang/fr-FR.rc
+++ b/dll/win32/shimgvw/lang/fr-FR.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Visionneuse d'Images et Fax de ReactOS"
IDS_SETASDESKBG "Définir comme Arrière-plan du Bureau"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Aperçu"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Image Suivante"
diff --git a/dll/win32/shimgvw/lang/he-IL.rc b/dll/win32/shimgvw/lang/he-IL.rc
index dbec4c39c2a..c90d0e79dd1 100644
--- a/dll/win32/shimgvw/lang/he-IL.rc
+++ b/dll/win32/shimgvw/lang/he-IL.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "מציג התמונות והפקסים של ReactOS"
IDS_SETASDESKBG "קבע כרקע שולחן עבודה"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "תצוגה מקדימה"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "התמונה הבאה"
diff --git a/dll/win32/shimgvw/lang/it-IT.rc b/dll/win32/shimgvw/lang/it-IT.rc
index 82655f83807..f629ad69acc 100644
--- a/dll/win32/shimgvw/lang/it-IT.rc
+++ b/dll/win32/shimgvw/lang/it-IT.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Visualizzatore immagini e fax di ReactOS"
IDS_SETASDESKBG "Imposta come sfondo del desktop"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Anteprima"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Immagine successiva"
diff --git a/dll/win32/shimgvw/lang/ja-JP.rc b/dll/win32/shimgvw/lang/ja-JP.rc
index 28a75e0f099..2a7e13fe837 100644
--- a/dll/win32/shimgvw/lang/ja-JP.rc
+++ b/dll/win32/shimgvw/lang/ja-JP.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS画像とFAXビュアー"
IDS_SETASDESKBG "デスクトップの背景に設定する"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "プレビュー"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "次の画像"
diff --git a/dll/win32/shimgvw/lang/lt-LT.rc b/dll/win32/shimgvw/lang/lt-LT.rc
index 1ed29815677..631f493ae39 100644
--- a/dll/win32/shimgvw/lang/lt-LT.rc
+++ b/dll/win32/shimgvw/lang/lt-LT.rc
@@ -6,6 +6,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS paveikslėlių ir faksogramų peržiūros programa"
IDS_SETASDESKBG "Nustatyti kaip darbalaukio foną"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Preview"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Tolesnis paveikslėlis"
diff --git a/dll/win32/shimgvw/lang/no-NO.rc b/dll/win32/shimgvw/lang/no-NO.rc
index 4012786682c..f25300df06a 100644
--- a/dll/win32/shimgvw/lang/no-NO.rc
+++ b/dll/win32/shimgvw/lang/no-NO.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS bilde og Faks Viser"
IDS_SETASDESKBG "Sett som skrivebord bakgrunn"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Skriv ut"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Neste bilde"
diff --git a/dll/win32/shimgvw/lang/pl-PL.rc b/dll/win32/shimgvw/lang/pl-PL.rc
index 8fdfaea4581..2bb921f4fae 100644
--- a/dll/win32/shimgvw/lang/pl-PL.rc
+++ b/dll/win32/shimgvw/lang/pl-PL.rc
@@ -9,6 +9,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Przeglądarka obrazów i faksów ReactOS"
IDS_SETASDESKBG "Ustaw jako tło pulpitu"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Podgląd"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Następny obraz"
diff --git a/dll/win32/shimgvw/lang/pt-PT.rc b/dll/win32/shimgvw/lang/pt-PT.rc
index c6fa85a3ff6..ba02254631f 100644
--- a/dll/win32/shimgvw/lang/pt-PT.rc
+++ b/dll/win32/shimgvw/lang/pt-PT.rc
@@ -9,6 +9,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Visualizador de imagens e faxes do ReactOS"
IDS_SETASDESKBG "Definir como plano de fundo da área de trabalho"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Pre-visualizar"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Próxima imagem"
diff --git a/dll/win32/shimgvw/lang/ro-RO.rc b/dll/win32/shimgvw/lang/ro-RO.rc
index 81ff1466829..1dee13cca8c 100644
--- a/dll/win32/shimgvw/lang/ro-RO.rc
+++ b/dll/win32/shimgvw/lang/ro-RO.rc
@@ -11,6 +11,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Vizualizare fax și imagini"
IDS_SETASDESKBG "Plasează ca decor de fundal"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Previzionare"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Imaginea următare"
diff --git a/dll/win32/shimgvw/lang/ru-RU.rc b/dll/win32/shimgvw/lang/ru-RU.rc
index beab59399f8..2ae247055f5 100644
--- a/dll/win32/shimgvw/lang/ru-RU.rc
+++ b/dll/win32/shimgvw/lang/ru-RU.rc
@@ -4,6 +4,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Программа просмотра изображений и факсов"
IDS_SETASDESKBG "Установить как фон рабочего стола"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Предпросмотр"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Следующее изображение"
diff --git a/dll/win32/shimgvw/lang/sk-SK.rc b/dll/win32/shimgvw/lang/sk-SK.rc
index d5ae689c2b7..3216f9142ca 100644
--- a/dll/win32/shimgvw/lang/sk-SK.rc
+++ b/dll/win32/shimgvw/lang/sk-SK.rc
@@ -8,6 +8,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Zobrazovač obrázkov a faxov systému ReactOS"
IDS_SETASDESKBG "Nastaviť ako pozadie pracovnej plochy"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Preview" // Náhľad, Ukážka, Prezrieť ???
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Nasledujúci obrázok"
diff --git a/dll/win32/shimgvw/lang/sq-AL.rc b/dll/win32/shimgvw/lang/sq-AL.rc
index 6df55634315..79854867665 100644
--- a/dll/win32/shimgvw/lang/sq-AL.rc
+++ b/dll/win32/shimgvw/lang/sq-AL.rc
@@ -8,6 +8,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS Vëzhguesi i Fotove dhe Faxit"
IDS_SETASDESKBG "Vendos si Sfond Desktopi"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Shikim Paraprak"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Fotoja Tjetër"
diff --git a/dll/win32/shimgvw/lang/tr-TR.rc b/dll/win32/shimgvw/lang/tr-TR.rc
index 40dbcb53fc0..13f5db98659 100644
--- a/dll/win32/shimgvw/lang/tr-TR.rc
+++ b/dll/win32/shimgvw/lang/tr-TR.rc
@@ -6,6 +6,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS Resim ve Belgegeçer Görüntüleyicisi"
IDS_SETASDESKBG "Masaüstü Arka Planı Olarak Ayarla"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Ön İzleme"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Sonraki Resim"
diff --git a/dll/win32/shimgvw/lang/uk-UA.rc b/dll/win32/shimgvw/lang/uk-UA.rc
index ee64a5fddfe..9202a26843f 100644
--- a/dll/win32/shimgvw/lang/uk-UA.rc
+++ b/dll/win32/shimgvw/lang/uk-UA.rc
@@ -12,6 +12,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "Програма перегляду зображень і факсів ReactOS"
IDS_SETASDESKBG "Встановити як фон робочого столу"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "Перегляд"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Наступне зображення"
diff --git a/dll/win32/shimgvw/lang/zh-CN.rc b/dll/win32/shimgvw/lang/zh-CN.rc
index 0ba55768aa5..40cc06efc68 100644
--- a/dll/win32/shimgvw/lang/zh-CN.rc
+++ b/dll/win32/shimgvw/lang/zh-CN.rc
@@ -7,6 +7,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS 图片和传真查看器"
IDS_SETASDESKBG "设置为桌面背景"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "预览"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "下一张图片"
diff --git a/dll/win32/shimgvw/lang/zh-TW.rc b/dll/win32/shimgvw/lang/zh-TW.rc
index 44345ea6fce..1aee3fdc2fb 100644
--- a/dll/win32/shimgvw/lang/zh-TW.rc
+++ b/dll/win32/shimgvw/lang/zh-TW.rc
@@ -6,6 +6,7 @@ STRINGTABLE
BEGIN
IDS_APPTITLE "ReactOS 圖片和傳真檢視器"
IDS_SETASDESKBG "設定為桌面背景"
+ IDS_NOPREVIEW "No preview available."
IDS_PREVIEW "預覽"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "下一張圖片"
diff --git a/dll/win32/shimgvw/resource.h b/dll/win32/shimgvw/resource.h
index 8026b10e203..b54f96e98f8 100644
--- a/dll/win32/shimgvw/resource.h
+++ b/dll/win32/shimgvw/resource.h
@@ -38,6 +38,7 @@
/* Strings */
#define IDS_APPTITLE 100
#define IDS_SETASDESKBG 101
+#define IDS_NOPREVIEW 102
#define IDS_PREVIEW 550
/* Friendly File Type Names */
diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index de8dc0e0238..9215eae87bb 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -37,7 +37,7 @@
HINSTANCE hInstance;
SHIMGVW_SETTINGS shiSettings;
SHIMGVW_FILENODE *currentFile;
-GpImage *image;
+GpImage *image = NULL;
WNDPROC PrevProc = NULL;
HWND hDispWnd, hToolBar;
@@ -186,6 +186,9 @@ static void ZoomInOrOut(BOOL bZoomIn)
{
INT i;
+ if (image == NULL)
+ return;
+
if (bZoomIn) /* zoom in */
{
/* find next step */
@@ -237,6 +240,9 @@ static void ResetZoom(void)
RECT Rect;
UINT ImageWidth, ImageHeight;
+ if (image == NULL)
+ return;
+
/* get disp window size and image size */
GetClientRect(hDispWnd, &Rect);
GdipGetImageWidth(image, &ImageWidth);
@@ -329,6 +335,9 @@ static void pSaveImageAs(HWND hwnd)
UINT j;
WCHAR *c;
+ if (image == NULL)
+ return;
+
GdipGetImageEncodersSize(&num, &size);
codecInfo = malloc(size);
if (!codecInfo)
@@ -421,32 +430,54 @@ static void pSaveImageAs(HWND hwnd)
free(codecInfo);
}
+static VOID
+pPrintImage(HWND hwnd)
+{
+ /* FIXME */
+}
+
+static VOID
+EnableToolBarButtons(BOOL bEnable)
+{
+ SendMessage(hToolBar, TB_ENABLEBUTTON, IDC_SAVE, bEnable);
+ SendMessage(hToolBar, TB_ENABLEBUTTON, IDC_PRINT, bEnable);
+}
+
static VOID
pLoadImageFromNode(SHIMGVW_FILENODE *node, HWND hwnd)
{
WCHAR szTitleBuf[800];
WCHAR szResStr[512];
- WCHAR *c;
+ LPWSTR pchFileTitle;
- if (node)
+ if (image)
{
- c = wcsrchr(node->FileName, '\\');
- if (c)
- {
- c++;
- }
+ GdipDisposeImage(image);
+ image = NULL;
+ }
- LoadStringW(hInstance, IDS_APPTITLE, szResStr, ARRAYSIZE(szResStr));
- StringCbPrintfW(szTitleBuf, sizeof(szTitleBuf), L"%ls%ls%ls", szResStr,
L" - ", c);
- SetWindowTextW(hwnd, szTitleBuf);
+ if (node == NULL)
+ {
+ EnableToolBarButtons(FALSE);
+ return;
+ }
- if (image)
- {
- GdipDisposeImage(image);
- }
+ pLoadImage(node->FileName);
- pLoadImage(node->FileName);
+ LoadStringW(hInstance, IDS_APPTITLE, szResStr, ARRAYSIZE(szResStr));
+ if (image != NULL)
+ {
+ pchFileTitle = PathFindFileNameW(node->FileName);
+ StringCbPrintfW(szTitleBuf, sizeof(szTitleBuf),
+ L"%ls%ls%ls", szResStr, L" - ",
pchFileTitle);
+ SetWindowTextW(hwnd, szTitleBuf);
+ }
+ else
+ {
+ SetWindowTextW(hwnd, szResStr);
}
+
+ EnableToolBarButtons(image != NULL);
}
static SHIMGVW_FILENODE*
@@ -617,6 +648,8 @@ ImageView_DrawImage(HWND hwnd)
HBRUSH white;
HGDIOBJ hbrOld;
UINT uFlags;
+ WCHAR szText[128];
+ HGDIOBJ hFontOld;
hdc = BeginPaint(hwnd, &ps);
if (!hdc)
@@ -632,18 +665,34 @@ ImageView_DrawImage(HWND hwnd)
return;
}
- GdipGetImageWidth(image, &ImageWidth);
- GdipGetImageHeight(image, &ImageHeight);
+ GetClientRect(hwnd, &rect);
+ white = GetStockObject(WHITE_BRUSH);
+
+ if (image == NULL)
+ {
+ FillRect(hdc, &rect, white);
+
+ LoadStringW(hInstance, IDS_NOPREVIEW, szText, ARRAYSIZE(szText));
+
+ SetTextColor(hdc, RGB(0, 0, 0));
+ SetBkMode(hdc, TRANSPARENT);
- if (GetClientRect(hwnd, &rect))
+ hFontOld = SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
+ DrawTextW(hdc, szText, -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER |
+ DT_NOPREFIX);
+ SelectObject(hdc, hFontOld);
+ }
+ else
{
+ GdipGetImageWidth(image, &ImageWidth);
+ GdipGetImageHeight(image, &ImageHeight);
+
ZoomedWidth = (ImageWidth * ZoomPercents) / 100;
ZoomedHeight = (ImageHeight * ZoomPercents) / 100;
x = (rect.right - ZoomedWidth) / 2;
y = (rect.bottom - ZoomedHeight) / 2;
- white = GetStockObject(WHITE_BRUSH);
// Fill top part
margin = rect;
margin.bottom = y - 1;
@@ -903,46 +952,50 @@ ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM
lParam)
currentFile = currentFile->Prev;
pLoadImageFromNode(currentFile, hwnd);
}
-
break;
+
case IDC_NEXT:
{
currentFile = currentFile->Next;
pLoadImageFromNode(currentFile, hwnd);
}
-
break;
+
case IDC_ZOOMP:
- {
ZoomInOrOut(TRUE);
- }
- break;
+ break;
+
case IDC_ZOOMM:
- {
ZoomInOrOut(FALSE);
- }
- break;
+ break;
+
case IDC_SAVE:
pSaveImageAs(hwnd);
+ break;
- break;
case IDC_PRINT:
+ pPrintImage(hwnd);
+ break;
- break;
case IDC_ROT1:
{
- GdipImageRotateFlip(image, Rotate270FlipNone);
- ImageView_UpdateWindow(hwnd);
+ if (image)
+ {
+ GdipImageRotateFlip(image, Rotate270FlipNone);
+ ImageView_UpdateWindow(hwnd);
+ }
+ break;
}
- break;
case IDC_ROT2:
{
- GdipImageRotateFlip(image, Rotate90FlipNone);
- ImageView_UpdateWindow(hwnd);
+ if (image)
+ {
+ GdipImageRotateFlip(image, Rotate90FlipNone);
+ ImageView_UpdateWindow(hwnd);
+ }
+ break;
}
-
- break;
}
}
break;
@@ -1106,7 +1159,10 @@ ImageView_CreateWindow(HWND hwnd, LPWSTR szFileName)
pFreeFileList(currentFile);
if (image)
+ {
GdipDisposeImage(image);
+ image = NULL;
+ }
Anime_FreeInfo();