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++;
}