TOUCHGFX 图片旋转 TextureMapper

TextureMapper 控件 可以控制图片的放大和旋转

设置 TextureMapper 参数

Screen1ViewBase::Screen1ViewBase()
{

    textureMapper1.setXY(100, 44);
    textureMapper1.setBitmap(touchgfx::Bitmap(BITMAP_FAN_ID));
    textureMapper1.setWidth(449);
    textureMapper1.setHeight(364);
    textureMapper1.setBitmapPosition(92.000f, 54.500f);
    textureMapper1.setScale(0.500f);
    textureMapper1.setCameraDistance(1000.000f);
    textureMapper1.setOrigo(224.500f, 182.000f, 1000.000f);
    textureMapper1.setCamera(224.500f, 182.000f);
    textureMapper1.updateAngles(0.000f, 0.000f, 0.000f);
    textureMapper1.setRenderingAlgorithm(touchgfx::TextureMapper::NEAREST_NEIGHBOR);

    add(textureMapper1);
}

在定时器中更改角度,实现绕Z轴旋转

void Screen1View::handleTickEvent()
{
	static  int count = 0;
	float  angle = count*0.05f;


	textureMapper1.updateZAngle(angle);

	count++;
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值