你好,游客 登录 注册 搜索
背景:
阅读新闻

Android改变图像的饱和度、亮度和对比度

[日期:2012-02-23] 来源:Linux社区  作者:Linux [字体:大 中 小]

布局文件,比较简单:

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"  
  3.     android:layout_width="fill_parent" android:layout_height="fill_parent"  
  4.     android:orientation="vertical">  
  5.   
  6.     <ImageView android:id="@+id/dstImageView" android:scaleType="fitCenter"  
  7.         android:layout_width="fill_parent" android:layout_height="wrap_content"  
  8.         android:maxWidth="240px" android:maxHeight="240px" />  
  9.   
  10.     <LinearLayout android:layout_width="fill_parent"  
  11.         android:layout_height="wrap_content" android:orientation="vertical">  
  12.         <LinearLayout android:layout_width="fill_parent"  
  13.             android:layout_height="wrap_content" android:orientation="horizontal"  
  14.             android:layout_alignParentBottom="true" android:gravity="center_vertical">  
  15.   
  16.             <TextView android:layout_width="wrap_content"  
  17.                 android:layout_height="wrap_content" android:text="@string/Saturation" />  
  18.   
  19.             <!-- 定义一个拖动条,并改变它的滑块外观 -->  
  20.             <SeekBar android:id="@+id/Saturationseekbar"  
  21.                 android:layout_width="fill_parent" android:layout_height="wrap_content"  
  22.                 android:progress="100" android:max="200" />  
  23.         </LinearLayout>  
  24.   
  25.         <LinearLayout android:layout_width="fill_parent"  
  26.             android:layout_height="wrap_content" android:orientation="horizontal"  
  27.             android:gravity="center_vertical">  
  28.   
  29.             <TextView android:layout_width="wrap_content"  
  30.                 android:layout_height="wrap_content" android:text="@string/Brightness" />  
  31.   
  32.             <!-- 定义一个拖动条,并改变它的滑块外观 -->  
  33.             <SeekBar android:id="@+id/Brightnessseekbar"  
  34.                 android:layout_width="fill_parent" android:layout_height="wrap_content"  
  35.                 android:progress="127" android:max="255" />  
  36.         </LinearLayout>  
  37.   
  38.         <LinearLayout android:layout_width="fill_parent"  
  39.             android:layout_height="wrap_content" android:orientation="horizontal"  
  40.             android:gravity="center_vertical">  
  41.   
  42.             <TextView android:layout_width="wrap_content"  
  43.                 android:layout_height="wrap_content" android:text="@string/Contrast" />  
  44.   
  45.             <!-- 定义一个拖动条,并改变它的滑块外观 -->  
  46.             <SeekBar android:id="@+id/Contrastseekbar"  
  47.                 android:layout_width="fill_parent" android:layout_height="wrap_content"  
  48.                 android:progress="63" android:max="127" />  
  49.         </LinearLayout>  
  50.     </LinearLayout>  
  51. </LinearLayout>  

运行结果:

Android改变图像的饱和度、亮度和对比度
linux
相关资讯       Android开发 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款