Tag Archives: bitmap

13,962 views

Rotate Canvas with Bitmap Android example

drawPath, canvas.rotate, lineTo basic Android example for your testing. // http://www.apache.org/licenses/LICENSE-2.0 // The Android Open Source Project public class MainActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Rotate Canvas with Bitmap Android example
12,225 views

Copy save Bitmap Image Pictures Android example

Copy file to another File path = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES); File file = new File(path, "MyPicture.jpg"); // the Pictures directory exists? path.mkdirs(); InputStream is = getResources().openRawResource(R.drawable.flower_blue); OutputStream os = new FileOutputStream(file); byte[] data = new byte[is.available()]; is.read(data); os.write(data); is.close(); os.close(); Copy … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Copy save Bitmap Image Pictures Android example
30,120 views

Color Picker Dialog Android example

Select color from menu and touch the screen. // MainActivity.java public class MainActivity extends Activity implements ColorPickerDialog.OnColorChangedListener { // http://www.apache.org/licenses/LICENSE-2.0 protected int _color = Color.GREEN;   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPaint = new Paint(); mPaint.setColor(Color.RED); setContentView(new SampleView(this)); … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Color Picker Dialog Android example
16,837 views

Bitmap Canvas Color Gradient linear radial sweep rounded corner Android example

public class MainActivity extends Activity { // http://www.apache.org/licenses/LICENSE-2.0 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends View { private Rect mRect; private GradientDrawable mDrawable;   public SampleView(Context context) { super(context); setFocusable(true);   … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Bitmap Canvas Color Gradient linear radial sweep rounded corner Android example
19,740 views

drawBitmap, clipPath, UNION, DIFFERENCE, INTERSECT, REPLACE, XOR Android example

public class MainActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends View {   // CONSTRUCTOR public SampleView(Context context) { super(context); setFocusable(true);   }   @Override protected void … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on drawBitmap, clipPath, UNION, DIFFERENCE, INTERSECT, REPLACE, XOR Android example
18,883 views

Convert a Bitmap to Gray Scale Android example

Black and white bitmap image pictures, gray scale colormatrix Android example. public class ApokusActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends View {   // CONSTRUCTOR public … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Convert a Bitmap to Gray Scale Android example
36,718 views

Crop cropped cut bitmap image pictures Android example

Cut, shear, clip, snip, crop a bitmap, picture, image Android example public class ApokusActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends View {   // CONSTRUCTOR public … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Crop cropped cut bitmap image pictures Android example
29,352 views

Resize a bitmap image Android example

public class ApokusActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends View {   // CONSTRUCTOR public SampleView(Context context) { super(context); setFocusable(true);   }   @Override protected void … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Resize a bitmap image Android example
15,717 views

Rotate a image bitmap picture Android example

Rotate a bitmap Android source code. public class MainActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }     private static class SampleView extends View {   // CONSTRUCTOR public SampleView(Context context) { super(context); … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Rotate a image bitmap picture Android example
21,569 views

Compressing converting a bitmap to PNG format Android example

public class MainActivity extends Activity {   @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static Bitmap codec(Bitmap src, Bitmap.CompressFormat format, int quality) { ByteArrayOutputStream os = new ByteArrayOutputStream(); src.compress(format, quality, os);   byte[] array = … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Compressing converting a bitmap to PNG format Android example