質問編集履歴
3
写真の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -239,3 +239,11 @@
|
|
239
239
|
|
240
240
|
|
241
241
|
https://stackoverflow.com/questions/43017826/using-system-drawing-imaging-imaging-does-not-exist-in-the-system-drawing
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
###追記
|
246
|
+
|
247
|
+
![config](ad58ef5720737fe1c0707cc31a34e7b1.png)
|
248
|
+
|
249
|
+
![ファイル](661a240508413d7a756605cf3c12e79b.png)
|
2
ソースコード編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -170,58 +170,58 @@
|
|
170
170
|
|
171
171
|
|
172
172
|
|
173
|
-
PATHは自分の環境に変更してあります。
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
using System;
|
173
|
+
using System.IO;
|
178
174
|
|
179
175
|
using CSharpStudy.Image;
|
180
176
|
|
181
|
-
|
177
|
+
using UnityEngine;
|
182
|
-
|
178
|
+
|
179
|
+
|
180
|
+
|
183
|
-
namespace CSharpStudy
|
181
|
+
namespace CSharpStudy {
|
184
|
-
|
185
|
-
|
182
|
+
|
186
|
-
|
187
|
-
class Program
|
183
|
+
class Program : MonoBehaviour {
|
188
|
-
|
184
|
+
|
189
|
-
{
|
185
|
+
void Start() {
|
186
|
+
|
190
|
-
|
187
|
+
// Assets/Textures/one.png を使う
|
188
|
+
|
189
|
+
string BITMAP1_PATH = Path.Combine(Application.dataPath, "images", "CameraScreenShot.png");
|
190
|
+
|
191
|
+
// Assets/Textures/two.png を使う
|
192
|
+
|
193
|
+
string BITMAP2_PATH = Path.Combine(Application.dataPath, "images", "CameraScreenShot2.png");
|
194
|
+
|
195
|
+
// 差分画像を Assets/Texturesフォルダ に diff.png という名前で保存
|
196
|
+
|
197
|
+
string DIFF_IMG_PATH = Path.Combine(Application.dataPath, "images", "diff.png");
|
198
|
+
|
191
|
-
private const string BITMAP1_PATH = @"
|
199
|
+
//private const string BITMAP1_PATH = @"Assets/images/CameraScreenShot.png";
|
192
|
-
|
200
|
+
|
193
|
-
private const string BITMAP2_PATH = @"
|
201
|
+
//private const string BITMAP2_PATH = @"Assets/images/CameraScreenShot2.png";
|
194
|
-
|
202
|
+
|
195
|
-
private const string DIFF_IMG_PATH = @"
|
203
|
+
//private const string DIFF_IMG_PATH = @"Assets/images/diff_image.png";
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
204
|
+
|
200
|
-
|
201
|
-
|
205
|
+
|
206
|
+
|
207
|
+
|
202
208
|
|
203
209
|
bool isSame = ImageComparator.Compare(BITMAP1_PATH, BITMAP2_PATH, DIFF_IMG_PATH);
|
204
210
|
|
205
211
|
|
206
212
|
|
207
|
-
if (isSame)
|
213
|
+
if (isSame) {
|
208
|
-
|
209
|
-
|
214
|
+
|
210
|
-
|
211
|
-
|
215
|
+
Debug.Log("2つの画像は同じです。");
|
216
|
+
|
217
|
+
} else {
|
218
|
+
|
219
|
+
Debug.Log("2つの画像は異なります。");
|
220
|
+
|
221
|
+
Debug.Log("次の差分ファイルを確認してください。:" + DIFF_IMG_PATH);
|
212
222
|
|
213
223
|
}
|
214
224
|
|
215
|
-
else
|
216
|
-
|
217
|
-
{
|
218
|
-
|
219
|
-
System.Console.WriteLine("2つの画像は異なります。");
|
220
|
-
|
221
|
-
System.Console.WriteLine("次の差分ファイルを確認してください。:" + DIFF_IMG_PATH);
|
222
|
-
|
223
|
-
}
|
224
|
-
|
225
225
|
}
|
226
226
|
|
227
227
|
}
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -170,6 +170,10 @@
|
|
170
170
|
|
171
171
|
|
172
172
|
|
173
|
+
PATHは自分の環境に変更してあります。
|
174
|
+
|
175
|
+
|
176
|
+
|
173
177
|
using System;
|
174
178
|
|
175
179
|
using CSharpStudy.Image;
|