在android上的imageview上画画?

时间:2017-06-19 17:42:19

标签: android

有人知道如何在现有的图像视图中使用Android中的fingerpaintApi吗?

这是我在android中的图像视图上绘制文本的方式,我需要在图像视图上绘制颜色对话框来挑选颜色?

大多数情况下,它就像你有图像背景的油漆

private Bitmap ProcessingBitmap(){
    Bitmap bm1 = null;
    Bitmap newBitmap = null;

    bm1 = bitmapconv;

    Bitmap.Config config = bm1.getConfig();
    if(config == null){
        config = Bitmap.Config.ARGB_8888;
    }

    newBitmap = Bitmap.createBitmap(bm1.getWidth(), bm1.getHeight(), config);
    Canvas newCanvas = new Canvas(newBitmap);

    newCanvas.drawBitmap(bm1, 0, 0, null);

    /*
    String captionString = movabletext.getText().toString();
    if(captionString != null){
        Paint paintText = new Paint(Paint.ANTI_ALIAS_FLAG);
        paintText.setColor(Color.BLUE);
        paintText.setTextSize(50);
        paintText.setStyle(Paint.Style.FILL);
        paintText.setShadowLayer(10f, 10f, 10f, Color.BLACK);

        Rect rectText = new Rect();
        paintText.getTextBounds(captionString, 0, captionString.length(), rectText);

        newCanvas.drawText(captionString, 0, rectText.height(), paintText);

        Toast.makeText(getApplicationContext(), "drawText: " + captionString, Toast.LENGTH_LONG).show();
    } else{
        Toast.makeText(getApplicationContext(), "caption empty!", Toast.LENGTH_LONG).show();
    }
    */

    return newBitmap;
}

0 个答案:

没有答案