Back to project page our_days.
The source code is released under:
Apache License
If you think the Android project our_days listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.meg7.widget; //from w w w .j a v a2s . c om import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; import android.util.AttributeSet; /** * Created by Mostafa Gazar on 11/2/13. */ public class RectangleImageView extends BaseImageView { public RectangleImageView(Context context) { super(context); } public RectangleImageView(Context context, AttributeSet attrs) { super(context, attrs); } public RectangleImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public static Bitmap getBitmap(int width, int height) { Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setColor(Color.BLACK); canvas.drawRect(new RectF(0.0f, 0.0f, width, height), paint); return bitmap; } @Override public Bitmap getBitmap() { return getBitmap(getWidth(), getHeight()); } }