【问题标题】:How to add Frames to images in Android如何在 Android 中为图像添加框架
【发布时间】:2013-01-22 19:51:53
【问题描述】:

我是 Android 应用程序开发的新手,我想创建一个应用程序,我可以在其中为图库中的图像或从相机拍摄的新照片添加边框或框架,我搜索了一些博客但我没有得到答案。

谁能告诉我有关如何执行该应用程序的想法或任何概念?

【问题讨论】:

    标签: android border frame image-editing


    【解决方案1】:

    在您从相机或图库中获取位图后(关于此的大量文档),您应该使用透明位图添加叠加层。

    这些链接应该可以帮助你(stackoverflow):

    另外,处理位图时的一些有用信息:

    http://android.nakatome.net/2010/04/bitmap-basics.html

    【讨论】:

      【解决方案2】:

      你可以通过使用下面的代码来实现这一点..我认为它可以帮助你

      <FrameLayout
          android:id="@+id/image_layoutf"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" >
      
          <LinearLayout
              android:id="@+id/bbb"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="#00000000"
              android:orientation="vertical" >
      
              <ImageView
                  android:id="@+id/border_image"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@drawable/backgroundimage1" />
      
          </LinearLayout>
      
          <LinearLayout
              android:id="@+id/bbb2"
              android:layout_width="fill_parent"
              android:layout_height="50dp"
              android:layout_gravity="bottom"
              android:background="@android:color/black"
              android:orientation="vertical" >
      
              <ImageView
                  android:id="@+id/border_image"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@drawable/frame1" />
          </LinearLayout>
      </FrameLayout>
      

      【讨论】:

        猜你喜欢
        • 2013-02-02
        • 2020-05-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-15
        • 2015-01-29
        • 1970-01-01
        • 2021-09-23
        相关资源
        最近更新 更多