tim_a_lacey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2015
05:02 PM
9-slice scaling
Are there any support libraries for 9-slice scaling of images?
Reference: http://radleymarx.com/blog/simple-guide-to-9-patch/
Context: using bitmaps in the 2D API
My current alternative is to split my image file into 9 separate files and scale the non-corner pieces accordingly. I'm putting the feelers out as 9-slice scaling would be simpler.
Any help is appreciated.
Reference: http://radleymarx.com/blog/simple-guide-to-9-patch/
Context: using bitmaps in the 2D API
My current alternative is to split my image file into 9 separate files and scale the non-corner pieces accordingly. I'm putting the feelers out as 9-slice scaling would be simpler.
Any help is appreciated.
2 REPLIES 2

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2015
10:09 PM
Re: 9-slice scaling
I wrote my own 9-patch library, but I'm not at liberty to share it. The key is to use ifBitmap.GetByteArray() to get the scaling and padding pixels, then split the image up with roRegions based on those pixel calculations for scaling.
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)
tim_a_lacey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2015
02:59 AM
Re: 9-slice scaling
"TheEndless" wrote:
I wrote my own 9-patch library, but I'm not at liberty to share it. The key is to use ifBitmap.GetByteArray() to get the scaling and padding pixels, then split the image up with roRegions based on those pixel calculations for scaling.
Thanks for your input TheEndless. Given more time, I'd give that a try.
For the sake of simplicity I have resorted to manually splitting my image file into separate files and scaling accordingly with DrawScaledObject() and the Draw2D API.
Thanks.