teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

写真の追加

2021/01/14 11:29

投稿

1236
1236

スコア19

title CHANGED
File without changes
body CHANGED
@@ -118,4 +118,8 @@
118
118
  ### 補足情報(FW/ツールのバージョンなど)
119
119
  英語で読めませんが同じ質問(?)
120
120
 
121
- https://stackoverflow.com/questions/43017826/using-system-drawing-imaging-imaging-does-not-exist-in-the-system-drawing
121
+ https://stackoverflow.com/questions/43017826/using-system-drawing-imaging-imaging-does-not-exist-in-the-system-drawing
122
+
123
+ ###追記
124
+ ![config](ad58ef5720737fe1c0707cc31a34e7b1.png)
125
+ ![ファイル](661a240508413d7a756605cf3c12e79b.png)

2

ソースコード編集

2021/01/14 11:29

投稿

1236
1236

スコア19

title CHANGED
File without changes
body CHANGED
@@ -84,32 +84,32 @@
84
84
  ```C#
85
85
  Program.cs
86
86
 
87
- PATHは自分の環境に変更してあります。
88
-
89
- using System;
87
+ using System.IO;
90
88
  using CSharpStudy.Image;
89
+ using UnityEngine;
91
90
 
92
- namespace CSharpStudy
91
+ namespace CSharpStudy {
93
- {
94
- class Program
92
+ class Program : MonoBehaviour {
95
- {
93
+ void Start() {
94
+ // Assets/Textures/one.png を使う
95
+ string BITMAP1_PATH = Path.Combine(Application.dataPath, "images", "CameraScreenShot.png");
96
+ // Assets/Textures/two.png を使う
97
+ string BITMAP2_PATH = Path.Combine(Application.dataPath, "images", "CameraScreenShot2.png");
98
+ // 差分画像を Assets/Texturesフォルダ に diff.png という名前で保存
99
+ string DIFF_IMG_PATH = Path.Combine(Application.dataPath, "images", "diff.png");
96
- private const string BITMAP1_PATH = @"C:\Users\NKOJIMA\source\repos\CSharpStudy\CSharpStudy\Image\cat1.png";
100
+ //private const string BITMAP1_PATH = @"Assets/images/CameraScreenShot.png";
97
- private const string BITMAP2_PATH = @"C:\Users\NKOJIMA\source\repos\CSharpStudy\CSharpStudy\Image\cat2.png";
101
+ //private const string BITMAP2_PATH = @"Assets/images/CameraScreenShot2.png";
98
- private const string DIFF_IMG_PATH = @"C:\Users\NKOJIMA\source\repos\CSharpStudy\CSharpStudy\Image\diff_image.png";
102
+ //private const string DIFF_IMG_PATH = @"Assets/images/diff_image.png";
99
103
 
100
- static void Main(string[] args)
104
+
101
- {
102
105
  bool isSame = ImageComparator.Compare(BITMAP1_PATH, BITMAP2_PATH, DIFF_IMG_PATH);
103
106
 
104
- if (isSame)
107
+ if (isSame) {
105
- {
106
- System.Console.WriteLine("2つの画像は同じです。");
108
+ Debug.Log("2つの画像は同じです。");
109
+ } else {
110
+ Debug.Log("2つの画像は異なります。");
111
+ Debug.Log("次の差分ファイルを確認してください。:" + DIFF_IMG_PATH);
107
112
  }
108
- else
109
- {
110
- System.Console.WriteLine("2つの画像は異なります。");
111
- System.Console.WriteLine("次の差分ファイルを確認してください。:" + DIFF_IMG_PATH);
112
- }
113
113
  }
114
114
  }
115
115
  }

1

追記

2021/01/14 07:06

投稿

1236
1236

スコア19

title CHANGED
File without changes
body CHANGED
@@ -84,6 +84,8 @@
84
84
  ```C#
85
85
  Program.cs
86
86
 
87
+ PATHは自分の環境に変更してあります。
88
+
87
89
  using System;
88
90
  using CSharpStudy.Image;
89
91