Ninepatch from file?

Put your problem here if it does not fit any of the other categories.

Ninepatch from file?

Postby elnoxvie » Thu Feb 10, 2011 4:58 am

I am creating a theme-able program. However, i am stuck at loading a ninepatch from file e.q. SDCARD. Every time i load a nine-patch with the chunks. it always come back with an error

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. byte[] chunk = createNinePatch(bitmap);//{64,79, 9,34}; // get a bitmap chunks
  2. NinePatch ninePatch = new NinePatch(bitmap, chunk, "");
  3.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


02-10 03:48:35.080: ERROR/AndroidRuntime(3225): Caused by: java.lang.RuntimeException: Array too small for chunk.
02-10 03:48:35.080: ERROR/AndroidRuntime(3225): at android.graphics.NinePatch.validateNinePatchChunk(Native Method)
02-10 03:48:35.080: ERROR/AndroidRuntime(3225): at android.graphics.NinePatch.<init>(NinePatch.java:50)
02-10 03:48:35.080: ERROR/AndroidRuntime(3225): at com.elnware.ActiveApps.ThemesLoader.setMainBg(ThemesLoader.java:170)
02-10 03:48:35.080: ERROR/AndroidRuntime(3225): at com.elnware.ActiveApps.ThemesLoader.loadTheme(ThemesLoader.java:46)
02-10 03:48:35.080: ERROR/AndroidRuntime(3225): at com.elnware.ActiveApps.Main.onCreate(Main.java:60)

Any ideas how to solve this?
elnoxvie
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Sep 01, 2010 9:28 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 19 guests