diff --git a/app/src/main/java/xdsopl/robot36/MainActivity.java b/app/src/main/java/xdsopl/robot36/MainActivity.java index 7ca3172..880654a 100644 --- a/app/src/main/java/xdsopl/robot36/MainActivity.java +++ b/app/src/main/java/xdsopl/robot36/MainActivity.java @@ -430,7 +430,7 @@ public class MainActivity extends AppCompatActivity { public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_store_scope) { - storeBitmap(scopeBitmap); + storeScope(); return true; } if (id == R.id.action_auto_mode) { @@ -576,6 +576,14 @@ public class MainActivity extends AppCompatActivity { return super.onOptionsItemSelected(item); } + private void storeScope() { + int width = scopeBuffer.width; + int height = scopeBuffer.height / 2; + int stride = scopeBuffer.width; + int offset = stride * scopeBuffer.line; + storeBitmap(Bitmap.createBitmap(scopeBuffer.pixels, offset, stride, width, height, Bitmap.Config.ARGB_8888)); + } + private void createScope(Configuration config) { int width = scopeBuffer.width; int height = scopeBuffer.height / 2;