j2me调用摄像头拍照函数getSnapshot的参数

最近写了一个关于j2me调用手机摄像头拍照的程序,开始在网上找了一段调用拍照的代码,其实就一个函数的事,getSnapshot(java.lang.String imageType)关于里面的参数,都一般是写null 文档上的解释是,null的话默认拍下来来的图片为png格式的,我测试过用流保存之后,把后缀改成.jpg的话,保存之后,在电脑上打开也是用png的方式打开的。要想转换成jpg的格式,就要从imageType这个参数下手了,但是网上关于imageType的参数不多,文档上也有一些解释,在模拟器上测试时,设置imageType="width=800&height=600",测试时,发现出错,改为null后测试出在模拟器(sun自带的wtk)上拍出的照片大小为160*120,那到n97上测试时,当imageType为null时,拍出的图片大小为640*480,那到5700上测试时,拍出的图片大小又不一样,是320*240,在n97上测试imageType="width=800&height=600"这个参数时没报错,可以拍出这大小的照片,根据一下列出的一些参数,还可以拍出其他的不同信息的图片,也可以加上参数imageType="encoding=jpeg&width=800&height=600",则可以拍出JPEG格式的图片,大家可以多试试其他的参数
video_encodings = video_enc_param *( "&" video_param )
video_enc_param = "encoding=" video_enc
video_enc = "gray8" / "rgb888" / "bgr888" /
"rgb565" / "rgb555" / "yuv444" /
"yuv422" / "yuv420" / "jpeg" / "png" /
content_type
video_param = "width=" width /
"height=" height /
"fps=" fps /
"colors=" colors /
"progressive=" progressive /
"interlaced=" interlaced /
"type=" video_type
width = pos_integer
height = pos_integer
fps = pos_number
quality = pos_integer
colors = "p" colors_in_palette /
= "rgb" r_bits g_bits b_bits /
= "gray" gray_bits
colors_in_palette = pos_integer
r_bits = pos_integer
g_bits = pos_integer
b_bits = pos_integer
gray_bits = pos_integer
progressive = boolean
video_type = jfif / exif / other_type
other_type = alphanumeric
interlaced = boolean
pos_number = 1*DIGIT [ "." 1*DIGIT ]
boolean = "true" / "false"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值