J2ME从零开始(学习笔记10)

j2me之游戏开发前序——图片旋转

 

MIDP1.0不支持旋转,现状的MIDP2.0 提供了旋转支持

TRANS_MIRROR
          Causes the Sprite to appear reflected about its vertical center.
static intTRANS_MIRROR_ROT180
          Causes the Sprite to appear reflected about its vertical center and then rotated clockwise by 180 degrees.
static intTRANS_MIRROR_ROT270
          Causes the Sprite to appear reflected about its vertical center and then rotated clockwise by 270 degrees.
static intTRANS_MIRROR_ROT90
          Causes the Sprite to appear reflected about its vertical center and then rotated clockwise by 90 degrees.
static intTRANS_NONE
          No transform is applied to the Sprite.
static intTRANS_ROT180
          Causes the Sprite to appear rotated clockwise by 180 degrees.
static intTRANS_ROT270
          Causes the Sprite to appear rotated clockwise by 270 degrees.
static intTRANS_ROT90
          Causes the Sprite to appear rotated clockwise by 90 degrees.

这个是从API中贴过来的,详细请参考J2ME API

 

下面是实现图片的旋转,图片格式png

 

 

这是个MIDlet类

 

 

Canvas类主要实现图片的旋转

实现效果见图

效果图这里注释我也没有写多少,相信看到的人也能明白,主要是对些坐标的操作,很简单,共勉

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值