crawfishmedia
12 years agoBinge Watcher
Rotating image in ImageCanvas
Hi all, Can someone please tell me why rotating an image in Image Canvas is so difficult? Based on the documentation this should work. What am I missing? The image is a PNG. Thanks.
canvasItems = []
photo_x = 600
photo_y = 300
photo_h = 300
photo_w = 300
photo_w_t = photo_w / 2
photo_h_t = photo_h / 2
rotate = 90.0
canvasItems.Push({
url:URLtoImage
TargetRect:{ x:photo_x, y:photo_y, w:photo_w, h:photo_h }
TargetTranslation:{ x:photo_w_t, y:photo_h_t }
TargetRotation:rotate
})
canvas = CreateObject("roImageCanvas")
port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
canvas.AllowUpdates(true)
canvas.SetRequireAllImagesToDraw(false)
canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
canvas.SetLayer(1, canvasItems)
canvas.Show()
canvasItems = []
photo_x = 600
photo_y = 300
photo_h = 300
photo_w = 300
photo_w_t = photo_w / 2
photo_h_t = photo_h / 2
rotate = 90.0
canvasItems.Push({
url:URLtoImage
TargetRect:{ x:photo_x, y:photo_y, w:photo_w, h:photo_h }
TargetTranslation:{ x:photo_w_t, y:photo_h_t }
TargetRotation:rotate
})
canvas = CreateObject("roImageCanvas")
port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
canvas.AllowUpdates(true)
canvas.SetRequireAllImagesToDraw(false)
canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
canvas.SetLayer(1, canvasItems)
canvas.Show()