csPlay
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2012
05:11 AM
roScreen/roImageCanvas Image Fitting Problem
Hi,
I am currently using asyngettofile to download the image locally to the tmp:/ storage. However, the image returned differs in size. Essentially, I would like to do the "scale to fit" display mode functionality in roScreen or roImageCanvas for better customization instead of using the roSlideshowscreen. Has anyone encountered this problem before? Any share of approach or information is greatly appreciated.
Thanks in advance.
I am currently using asyngettofile to download the image locally to the tmp:/ storage. However, the image returned differs in size. Essentially, I would like to do the "scale to fit" display mode functionality in roScreen or roImageCanvas for better customization instead of using the roSlideshowscreen. Has anyone encountered this problem before? Any share of approach or information is greatly appreciated.
Thanks in advance.
5 REPLIES 5

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2012
09:08 AM
Re: roScreen/roImageCanvas Image Fitting Problem
For roScreen, you'll need to calculate the scale based on the current screen resolution and use the DrawScaledObject method. For roImageCanvas, just specify the TargetRect with the width/height you want to scale to and you should be good to go. Regardless of which way you go, you'll need to calculate the scale yourself. There is no built-in "scale-to-fit" option for those screens.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
csPlay
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2012
09:17 AM
Re: roScreen/roImageCanvas Image Fitting Problem
Hi,
Thanks for the prompt reply and your input. One problem of not being able to draw the scaled object is because of the unknown width and height of the image returned from the server. The image is a binary file which I used gettofile urltransfer method to store it directly to tmp:/ storage and then display it by point the url to the tmp:/ storage. In this case, since I do not know the width and height of that image, how can I determine the scale of the object?
If I was to put the image in roSlideShow, it has no problem of putting the image to its scale option. I guess if my question can be more specific on how does the roSlideShowScreen determine the width and height of the image and scale it to the right size.
Thanks.
Thanks for the prompt reply and your input. One problem of not being able to draw the scaled object is because of the unknown width and height of the image returned from the server. The image is a binary file which I used gettofile urltransfer method to store it directly to tmp:/ storage and then display it by point the url to the tmp:/ storage. In this case, since I do not know the width and height of that image, how can I determine the scale of the object?
If I was to put the image in roSlideShow, it has no problem of putting the image to its scale option. I guess if my question can be more specific on how does the roSlideShowScreen determine the width and height of the image and scale it to the right size.
Thanks.
MSGreg
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2012
09:32 AM
Re: roScreen/roImageCanvas Image Fitting Problem
With roScreen you would read the binary file into a roBitmap, then use DrawScaleObject with bm.GetWidth() and bm.GetHeight()
With roImageCanvas you would use TargetRect. Which should work if already have the aspect ratio. You can get width and height and calculate aspect ratio of a local image file through roImageMetadata
Let us know how that works.
With roImageCanvas you would use TargetRect. Which should work if already have the aspect ratio. You can get width and height and calculate aspect ratio of a local image file through roImageMetadata
Let us know how that works.
csPlay
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2012
09:43 AM
Re: roScreen/roImageCanvas Image Fitting Problem
Thanks man, exactly what I needed.
ljunkie
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2014
09:09 AM
Re: roScreen/roImageCanvas Image Fitting Problem
Useful info! Many thanks.
note: updated link - roImageMetadata
note: updated link - roImageMetadata
"MSGreg" wrote:
With roScreen you would read the binary file into a roBitmap, then use DrawScaleObject with bm.GetWidth() and bm.GetHeight()
With roImageCanvas you would use TargetRect. Which should work if already have the aspect ratio. You can get width and height and calculate aspect ratio of a local image file through roImageMetadata]roImageMetadata
Let us know how that works.