Android自定义照相机实现近期小巫在学校有一个创新项目,也不是最近,是一个拖了很久的项目,之前一直没有去搞,最近因为要中期检查,搞得我跟小组成员一阵忙活,其实开发一款照相机软件并不太难,下面就是通过自定义的方式来实现手机照相的功能。创建
Android自定义照相机实现
近期小巫在学校有一个创新项目,也不是最近,是一个拖了很久的项目,之前一直没有去搞,最近因为要中期检查,搞得我跟小组成员一阵忙活,其实开发一款照相机软件并不太难,下面就是通过自定义的方式来实现手机照相的功能。
创建一个项目:FingerTakePicture
首先来搞一下界面:
<FrameLayout xmlns:Android="Http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/FrameLayout1" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- 显示预览图形 --> <SurfaceView android:id="@+id/surfaceView" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- 相对布局,放置两个按钮 --> <RelativeLayout android:id="@+id/buttonLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="Gone" > <!-- 拍照按钮 --> <Button android:id="@+id/takepicture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentBottom="true" android:background="@drawable/btn_tabkepicture_selector" android:onClick="btnOnclick" /> <ImageView android:id="@+id/scalePic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:layout_marginLeft="5dp" android:background="@drawable/img_showpic_selector" android:onClick="imageClick" /> </RelativeLayout> </FrameLayout>
--结束END--
本文标题: Android自定义照相机的实例
本文链接: https://www.lsjlt.com/news/222758.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
2024-05-11
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0