NinePatch Showing blacklines

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

NinePatch Showing blacklines

Postby elnoxvie » Fri Feb 11, 2011 7:43 am

I am doing a themeable Application and trying to load the 9 patch PNG file from sdcard.
It loaded ok by feeding the chunks manually. However, the black line shows when i set it into background.
if i got the bitmap from resource, by calling bitmapfactory.decoderesource(file), than it's working fine.

Any help will be appreciated. thanks.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                     Bitmap bitmap = BitmapFactory.decodeFile(src);
  2.                   byte[] chunk = {1, 2, 2, 9,
  3.                                                       0, 0, 0, 0, 0, 0, 0, 0, //xDIVS
  4.                                                       0, 0, 0, 0, 6, 0, 0, 0, //yDIVS
  5.                                                       0, 0, 0, 0, 3, 0, 0, 0,
  6.                                                       0, 0, 0, 0, 7, 0, 0, 0,
  7.                                                       -54, 1, 0, 0, 22, 0, 0, 0,
  8.                                                       73, 0, 0, 0, 1, 0, 0, 0,
  9.                                                       1, 0, 0, 0, 1, 0, 0, 0,
  10.                                                       1, 0, 0, 0, 1, 0, 0, 0,
  11.                                                       1, 0, 0, 0, 1, 0, 0,
  12.                                                       0, 1, 0, 0, 0, 1, 0, 0, 0};
  13.                            Rect rect = new Rect(10,10,10,10);
  14.                  
  15.                             NinePatchDrawable nineDrawable= new NinePatchDrawable(bitmap,chunk,rect,null);
  16.  
  17.         linearLayout.setBackgroundDrawable(nineDrawable);
  18.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
elnoxvie
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Sep 01, 2010 9:28 am

Top

Re: NinePatch Showing blacklines

Postby elnoxvie » Mon Feb 14, 2011 2:23 am

Never mind, i have figured out the issue. Thanks.
elnoxvie
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Sep 01, 2010 9:28 am

Re: NinePatch Showing blacklines

Postby Mardaneus » Tue Feb 15, 2011 1:34 pm

Please do tell what you have done to fix this. This might help others in the future.
Mardaneus
Junior Developer
Junior Developer
 
Posts: 14
Joined: Mon Feb 14, 2011 10:30 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests