简体   繁体   English

在另一张图片上添加一些图片

[英]adding some picture on the other picture

I need to add some picture (like a flower) to the other picture (main picture) . 我需要在其他图片(主图片)上添加一些图片(如花)。 i want to achieve that after user captures a picture then he can add the picture to that. 我想在用户捕获图片后实现这一点,然后他可以将图片添加到该图片中。 Is there a library can solve my problem? 有图书馆可以解决我的问题吗? just like this picture : 就像这张照片:

在此处输入图片说明

You can use FrameLayout . 您可以使用FrameLayout。

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

      >

    <ImageView
        android:id="@+id/image1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

      <ImageView
        android:id="@+id/image1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

Or use 或使用

Bitmap bitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);    
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(Color.BLACK);
canvas.drawBitmap(yourBitmap, 0, 0, paint) ; //Draw bitmap 
canvas.drawCircle(50, 50, 10, paint);        //Draw Circle
imageView.setImageBitmap(bitmap);

OR You can use this library ' https://github.com/codepath/android_guides/wiki/Basic-Painting-with-Views ' 或者您可以使用此库' https://github.com/codepath/android_guides/wiki/Basic-Painting-with-Views '

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM