store entire scope buffer

pull/11/head
Ahmet Inan 2024-05-08 12:08:43 +02:00
rodzic d554cfe5f6
commit 73a6a0436b
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -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;