jkard
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2011
03:55 PM
Centering An Image On roImageCanvas
I'm working with the roImageCanvas for the first time today, and am using it as a "Screen Facade" as recommended in the Developer Guidelines handbook. I'd like to center an image on the roImageCanvas, but am having issues getting it to do this.
No matter what I set in the "TargetRec" for my image, it is always displaying in the upper left corner of the monitor. What am I doing wrong and how do I center it?
Thanks all!!
Jay
screenFacade = CreateObject("roImageCanvas")
screenFacade.SetLayer(0,{Color:"#FF000000", CompositionMode:"Source"})
canvasItems = [
{
url:"pkg:/images/Splash/Splash.png"
TargetRec:{x:390, y:357, w:400, h:200}
}
{
Text:"Loading..."
TextAttrs:{
Color:"#FF0000",
Font:"Medium",
HAlign:"HCenter",
VAlign:"VCenter",
Direction:"LeftToRight"
}
}
]
screenFacade.SetRequireAllImagesToDraw(true)
screenFacade.SetLayer(1,canvasItems)
screenFacade.Show()
No matter what I set in the "TargetRec" for my image, it is always displaying in the upper left corner of the monitor. What am I doing wrong and how do I center it?
Thanks all!!
Jay
2 REPLIES 2

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2011
04:10 PM
Re: Centering An Image On roImageCanvas
TargetRect has a "t" on the end.
--Mark
--Mark
jkard
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2011
04:19 PM
Re: Centering An Image On roImageCanvas
Ahh!! Great, silly mistake on my part. I was thinking wrong on how the "TargetRect" was used, thanks for the great catch Mark!
Best
Jay
Best
Jay