Skip to content

Commit 9dd094e

Browse files
authored
Merge pull request #1137 from beru/ToolBarImageMuxer_keep_palette
ツールバー用のビットマップを結合するツール:インデックスカラー画像の場合はなるべく元のパレットを保持して結合するように対処を追加
2 parents 9dee176 + 8bf4b96 commit 9dd094e

10 files changed

Lines changed: 664 additions & 142 deletions

File tree

build-bmp-tools.bat

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,79 +28,51 @@ set SRC_BMP2=%~dp0resource\my_icons.bmp
2828
set DST_DIR1=%~dp0resource\mytool
2929
set DST_DIR2=%~dp0resource\my_icons
3030

31-
if exist %DST_DIR1% rmdir /s /q %DST_DIR1%
32-
if exist %DST_DIR2% rmdir /s /q %DST_DIR2%
31+
set OUT_BMP1=%~dp0resource\out-mytool.bmp
32+
set OUT_BMP2=%~dp0resource\out-my_icons.bmp
33+
3334
if exist %DST_DIR1% rmdir /s /q %DST_DIR1%
3435
if exist %DST_DIR2% rmdir /s /q %DST_DIR2%
3536

36-
@rem split input bmp
37+
@rem split input bmp file No.1
3738
%SPLITTER% %SRC_BMP1% %DST_DIR1%
3839
if errorlevel 1 (
3940
echo fail %SPLITTER% %SRC_BMP1% %DST_DIR1%
4041
exit /b 1
4142
)
4243

44+
@rem split input bmp file No.2
4345
%SPLITTER% %SRC_BMP2% %DST_DIR2%
4446
if errorlevel 1 (
4547
echo fail %SPLITTER% %SRC_BMP2% %DST_DIR2%
4648
exit /b 1
4749
)
4850

49-
@rem these steps are for tests.
50-
set OUT1_BMP1=%~dp0resource\out1-mytool.bmp
51-
set OUT1_BMP2=%~dp0resource\out1-my_icons.bmp
52-
set OUT2_BMP1=%~dp0resource\out2-mytool.bmp
53-
set OUT2_BMP2=%~dp0resource\out2-my_icons.bmp
54-
55-
set OUT_DIR1=%~dp0resource\mytool
56-
set OUT_DIR2=%~dp0resource\my_icons
57-
58-
@rem merge multiple bmp to one bmp
59-
%MUXER% %DST_DIR1% %OUT1_BMP1%
60-
if errorlevel 1 (
61-
echo fail %MUXER% %DST_DIR1% %OUT1_BMP1%
62-
exit /b 1
63-
)
64-
65-
%MUXER% %DST_DIR2% %OUT1_BMP2%
66-
if errorlevel 1 (
67-
echo fail %MUXER% %DST_DIR2% %OUT1_BMP2%
68-
exit /b 1
69-
)
70-
71-
%SPLITTER% %OUT1_BMP1% %OUT_DIR1%
72-
if errorlevel 1 (
73-
echo fail %SPLITTER% %OUT1_BMP1% %OUT_DIR1%
74-
exit /b 1
75-
)
76-
77-
%SPLITTER% %OUT1_BMP2% %OUT_DIR2%
78-
if errorlevel 1 (
79-
echo fail %SPLITTER% %OUT1_BMP2% %OUT_DIR2%
80-
exit /b 1
81-
)
82-
83-
%MUXER% %OUT_DIR1% %OUT2_BMP1%
51+
@rem merge separated bmp files into single bmp file
52+
%MUXER% %DST_DIR1% %OUT_BMP1%
8453
if errorlevel 1 (
85-
echo fail %MUXER% %OUT_DIR1% %OUT2_BMP1%
54+
echo fail %MUXER% %DST_DIR1% %OUT_BMP1%
8655
exit /b 1
8756
)
8857

89-
%MUXER% %OUT_DIR2% %OUT2_BMP2%
58+
@rem merge separated bmp files into single bmp file
59+
%MUXER% %DST_DIR2% %OUT_BMP2%
9060
if errorlevel 1 (
91-
echo fail %MUXER% %OUT_DIR2% %OUT2_BMP2%
61+
echo fail %MUXER% %DST_DIR2% %OUT_BMP2%
9262
exit /b 1
9363
)
9464

95-
fc /a /b %OUT1_BMP1% %OUT2_BMP1% >NUL
65+
@rem verify contents of merged bmp file is as same as source bitmap file
66+
fc /a /b %SRC_BMP1% %OUT_BMP1% >NUL
9667
if errorlevel 1 (
97-
echo fail fc /a /b %OUT1_BMP1% %OUT2_BMP1%
68+
echo fail fc /a /b %SRC_BMP1% %OUT_BMP1%
9869
exit /b 1
9970
)
10071

101-
fc /a /b %OUT1_BMP2% %OUT2_BMP2% >NUL
72+
@rem verify contents of merged bmp file is as same as source bitmap file
73+
fc /a /b %SRC_BMP2% %OUT_BMP2% >NUL
10274
if errorlevel 1 (
103-
echo fail fc /a /b %OUT1_BMP2% %OUT2_BMP2%
75+
echo fail fc /a /b %SRC_BMP2% %OUT_BMP2%
10476
exit /b 1
10577
)
10678

0 commit comments

Comments
 (0)