hi 
i would like to rotate some ui In my develop site
this is my sample code  please answer~
 
if (document.getElementById(“secondPannel”) != null) {
var c = new zebra.ui.zCanvas(“secondPannel”);
var r = c.root;
r.setLayout(new zebra.layout.BorderLayout());

r.add(zebra.layout.LEFT, createSecondLeftCenter());
r.add(zebra.layout.CENTER, createSecondCenter());

}
 
function createSecondCenter()
{
var p = new Panel([
function(){
this.$super(new RasterLayout());
var imgCanvas = zebra.ui.$canvas.create(100,100);

var context = zebra.ui.$canvas.context(imgCanvas);
var test = new Image();
test.src = “images/switchOn.png”;

context.drawImage(test, 100, 100);

context.rotate(1.0);

var guro = new ImagePan(imgCanvas);

guro.setBounds(10,100,120,50);

this.add(guro);

},
function paint(g) {

}

]);

return p;
}
 
 
 
 

1 answer

Staff October 27, 2015

In current zebra version you can rotate the whole zebra canvas, but not individual UI component. 

#1

Please login or Register to Submit Answer