Tag Archives: draw

27,158 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
14,430 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
19,794 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
65,700 views

Compressing a bitmap to JPG format Android example

Codec, compress(), CompressFormat, quality, decodeByteArray(), Android example source code with image. 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 … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Compressing a bitmap to JPG format Android example
18,512 views

Rounded rect RectF Android example

RectF, drawRoundRect(), 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 … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Rounded rect RectF Android example
32,066 views

Create bitmap and draw text into bitmap 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 onDraw(Canvas … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on Create bitmap and draw text into bitmap Android example
6,690 views

Create monochromatic bitmap 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 onDraw(Canvas … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on Create monochromatic bitmap Android example
15,229 views

Create Bitmap with Linear Gradient 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 onDraw(Canvas … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on Create Bitmap with Linear Gradient Android example
11,522 views

drawBitmap createBitmap by array of colours Android example

public static Bitmap createBitmap (int[] colors, int offset, int stride, int width, int height, Bitmap.Config config) public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint) // http://www.apache.org/licenses/LICENSE-2.0 public class MainActivity extends Activity { private static final int WIDTH … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on drawBitmap createBitmap by array of colours Android example
14,185 views

Draw text drawText Android basic example

drawText(), setColor(), setTextSize(), setTextAlign() 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 … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on Draw text drawText Android basic example