J2ME API记录(一)

一.NOKIA API

NOKIA UI API包括三个类一个接口:
com.nokia.mid.ui.DeviceControl类
flashLights(long duration) 
setLights(int num, int level):num,灯的ID
startVibra(int freq, long duration) :freq, 频率;duration周期
stopVibra() 

com.nokia.mid.ui.DirectUtils类
createImage(byte[] imageData, int imageOffset, int imageLength) 
createImage(int width, int height, int ARGBcolor) :ARGBcolor包括透明度的颜色值
getDirectGraphics(javax.microedition.lcdui.Graphics g) 

Class FullCanvas类
FullCanvas() //构造方法
addCommand(Command cmd) 
setCommandListener(CommandListener l) 

com.nokia.mid.ui.DirectGraphics接口
drawImage(javax.microedition.lcdui.Image img, int x, int y, int anchor, int manipulation) :anchor,对齐;manipulation,翻转操作,0x2000 :水平,0x4000 :垂直;90:逆时90度;180:逆时180度;270:逆时270度
drawPixels(byte[] pixels, byte[] transparencyMask, int offset, int scanlength, int x, int y, int width, int height, int manipulation, int format) :transparencyMask,透明度;manipulation,操作,0,无操作;format:格式,黑白还是彩色.
drawPixels(int[]/short[] pixels, boolean transparency, int offset, int scanlength, int x, int y, int width, int height, int manipulation, int format):transparency,是否透明.
setARGBColor(int argbColor) :argbColor,value (0xAARRGGBB)
getNativePixelFormat() :取得象素的格式
getAlphaComponent() :获取透明部分的值.
getPixels(……)。。。。。

NOKIA Sound API包括一个类一个接口:
com.nokia.mid.sound.Sound类
Sound(byte[] data, int type)//构造器 :type,声音格式
Sound(int freq, long duration) //构造器
getConcurrentSoundCount(int type) :取得设备能同时播放该type格式的最大数
getGain() :音量
getState() :状态
getSupportedFormats() :支持格式
init(byte[] data, int type) 
init(int freq, long duration) 
release() :释放设备
resume() :唤醒
setGain(int gain) :设置音量
setSoundListener(SoundListener listener) 
play(int loop) :loop,0:循环
stop() 

com.nokia.mid.sound.SoundListener接口
soundStateChanged(Sound sound, int event) :event ,SOUND_PLAYING:0; SOUND_STOPPED:1 ; SOUND_UNINITIALIZED:3


二。标准API
javax.microedition.lcdui.Graphics
clipRect(int x, int y, int width, int height) :缩小绘画区域
copyArea(int x_src, int y_src, int width, int height, int x_dest, int y_dest, int anchor) :拷贝区域,拷贝前后的区域必须在同一个可绘区域内。
drawRegion(Image src, int x_src, int y_src, int width, int height, int transform, int x_dest, int y_dest, int anchor) :transform:翻转
getDisplayColor(int color) :取得设备支持颜色数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值