質問編集履歴

4

該当のソースコード 誤植を修正。

2017/03/29 10:25

投稿

foomo
foomo

スコア12

test CHANGED
File without changes
test CHANGED
@@ -38,7 +38,7 @@
38
38
 
39
39
  Bitmap src = BitmapFactory.decodeFile(mfile.getPath());
40
40
 
41
- ImageView iv = (ImageView) //findViewById(R.id.picture); 誤植を修正
41
+ // ImageView iv = (ImageView) findViewById(R.id.picture); 誤植を修正
42
42
 
43
43
  ImageView iv = (ImageView) findViewById(R.id.foto);
44
44
 

3

該当のソースコード を修正。

2017/03/29 10:25

投稿

foomo
foomo

スコア12

test CHANGED
File without changes
test CHANGED
@@ -38,7 +38,9 @@
38
38
 
39
39
  Bitmap src = BitmapFactory.decodeFile(mfile.getPath());
40
40
 
41
+ ImageView iv = (ImageView) //findViewById(R.id.picture); 誤植を修正
42
+
41
- ImageView iv = (ImageView) findViewById(R.id.picture);
43
+ ImageView iv = (ImageView) findViewById(R.id.foto);
42
44
 
43
45
  iv.setImageBitmap(src);
44
46
 

2

該当のソースの追記

2017/03/29 10:24

投稿

foomo
foomo

スコア12

test CHANGED
File without changes
test CHANGED
@@ -20,7 +20,67 @@
20
20
 
21
21
 
22
22
 
23
+ Camera2BasicFragment.java::
24
+
25
+ ...
26
+
27
+ private final ImageReader.OnImageAvailableListener mOnImageAvailableListener
28
+
29
+ = new ImageReader.OnImageAvailableListener() {
30
+
31
+
32
+
33
+ @Override
34
+
35
+ public void onImageAvailable(ImageReader reader) {
36
+
37
+ mBackgroundHandler.post(new ImageSaver(reader.acquireNextImage(), mFile));
38
+
39
+ Bitmap src = BitmapFactory.decodeFile(mfile.getPath());
40
+
41
+ ImageView iv = (ImageView) findViewById(R.id.picture);
42
+
43
+ iv.setImageBitmap(src);
44
+
23
- -
45
+ }
46
+
47
+ };
48
+
49
+ ...
50
+
51
+
52
+
53
+ fragmet_camera2_basic.xml::
54
+
55
+ ...
56
+
57
+ <com.example.android.camera2basic.AutoFitTextureView
58
+
59
+ android:id="@+id/texture"
60
+
61
+ android:layout_width="90dp"
62
+
63
+ android:layout_height="160dp"
64
+
65
+ android:layout_alignParentStart="true"
66
+
67
+ android:layout_alignParentTop="true" />
68
+
69
+
70
+
71
+ <ImageView
72
+
73
+ android:id="@+id/foto"
74
+
75
+ android:layout_toRightOf="@+id/texture"
76
+
77
+ android:layout_width="wrap_content"
78
+
79
+ android:layout_height="320dp"
80
+
81
+ android:src="@drawable/foto"/>
82
+
83
+ ...
24
84
 
25
85
 
26
86
 

1

補足情報を追記しました。

2017/03/29 05:48

投稿

foomo
foomo

スコア12

test CHANGED
File without changes
test CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
 
30
30
 
31
- ・写真撮影+ファイル保存処理の後続に、ファイルをbitmapにdecodeしImageViewに渡す処理の実装を試みました。
31
+ サンプルプログラムとして動作の確認が取れている、写真撮影+ファイル保存処理の後続に、位置を少しづつ変えながら、ファイルをbitmapにdecodeしImageViewに渡す処理の実装を試みました。
32
32
 
33
33
 
34
34
 
@@ -48,6 +48,20 @@
48
48
 
49
49
  実装箇所に間違いがあるのだと思っています。
50
50
 
51
+ また、findViewByIdにパラメーターを与えていない点にも
52
+
53
+ 問題があると認識しています。
54
+
55
+
56
+
57
+ カメラのファインダーが実装されたfragment上にImageViewを実装するのは妥当か?
58
+
59
+ 写真保存後にその内容を表示する処理を実装するのに妥当な箇所は
60
+
61
+ どういった観点から判断すればよいのか(どの処理のあと/スコープは?)
62
+
63
+ などが分かっていません。
64
+
51
65
 
52
66
 
53
67
  ・検証には、Android Studioを使用して実機上で動作確認をしています。