NewbyDeveloper
11 years agoVisitor
Centre an Image
Hi
If I use this code:
canvasImg = CreateObject("roAssociativeArray")
canvasImg = [
{
url:imageUrl
TargetRect:{x:0,y:0,w:cw,h:ch}
}]
Regardless of the size of the target image it is scaled up to fit the screen.
And.. If I knew the image size, I could calculate the co-ords to make the image load in the centre of the screen....
...But is there a way to just make Brightscript automatically centre the image -as is- without any scaling - IF - you don't know the size of the target image?
I was looking for HAlign and VAlign properties like you have with TEXT..?
Thanks in advance if anyone can advise.
If I use this code:
canvasImg = CreateObject("roAssociativeArray")
canvasImg = [
{
url:imageUrl
TargetRect:{x:0,y:0,w:cw,h:ch}
}]
Regardless of the size of the target image it is scaled up to fit the screen.
And.. If I knew the image size, I could calculate the co-ords to make the image load in the centre of the screen....
...But is there a way to just make Brightscript automatically centre the image -as is- without any scaling - IF - you don't know the size of the target image?
I was looking for HAlign and VAlign properties like you have with TEXT..?
Thanks in advance if anyone can advise.