Could use some help with 9.png files

Discussion in 'Android Themes' started by chevycam94, Jun 12, 2010.

  1. chevycam94
    Offline

    chevycam94 Steel Droid ROM Developer Developer

    Joined:
    May 12, 2010
    Messages:
    1,373
    Likes Received:
    13
    Trophy Points:
    38
    Location:
    Central Ohio
    Could someone who has experience modifying the infamous 9.png files, give me a quick guide to how to mod them. I have the draw9patch program that comes with the newest Android SDK. Can I just use that? I dont even know where to start, and have trouble finding the right images that I want to modify. lol
  2. CorCor67
    Offline

    CorCor67 Premium Member Premium Member Developer

    Joined:
    May 2, 2010
    Messages:
    438
    Likes Received:
    2
    Trophy Points:
    0
    In draw9patch there will be a 1px border, this is the only area it will allow you to draw on. The top and right side determine the "stretch patches". The bottom and right side will determine the area in the image where content is okay to be placed(content patches). Draw your lines, keep the stretch patchs to 1px dots, but make the content patches a solid line. The reason for that is it seems to crash the compiler if you don't.


    I prefer the compiler found here:
    http://www.droidforums.net/forum/xeudoxus/47283-release-xultimate.html

    I haven't figured out how to set it to compile different folders, but if you put your images in the example folders it'll compile them, then pull them and stick them back in the apk.

    What images do you need to find? I can post screen shots of the process if needed.
  3. chevycam94
    Offline

    chevycam94 Steel Droid ROM Developer Developer

    Joined:
    May 12, 2010
    Messages:
    1,373
    Likes Received:
    13
    Trophy Points:
    38
    Location:
    Central Ohio
    If you could post screen shots of 2 examples of changing a 9.png file, that would be great. I learn better by SEEING, not as much by READING.
  4. CorCor67
    Offline

    CorCor67 Premium Member Premium Member Developer

    Joined:
    May 2, 2010
    Messages:
    438
    Likes Received:
    2
    Trophy Points:
    0
    This is an example of most widgets found pre-installed, its the widget from the theme I'm working on. If you check the boxes at the bottom of draw9patch, it will show your patches. You can see the top and left border have 1 1px dot each. The green bar running through shows you where the image will stretch. I believe it just repeats this 1px line until the image meets the required size, so don't put a patch over a textured area unless it looks good repeated :).

    You also see in the bar to the right a blue box inside my widget, this is the area I set for the content. I did this with the bottom and right 1px border, see the solid lines?
    View attachment 10126

    This next one is the search bar for the search widget. This one has the magnifying glass image so we have to work around it. You see the areas I designated for the stretch (top&left) are set so they don't run through the magnifying glass. Also we don't want content showing on the magnifying glass, see I stopped the bottom line before it, the right one controls the up and down so it doesn't affect the magnifying glass.
    View attachment 10127

    All you need to do it tell it where it is okay to stretch the image, and where it can display content. It's simple once you get it figured out. Hope this helps!
  5. chevycam94
    Offline

    chevycam94 Steel Droid ROM Developer Developer

    Joined:
    May 12, 2010
    Messages:
    1,373
    Likes Received:
    13
    Trophy Points:
    38
    Location:
    Central Ohio
    Wow, thank you very much. You would be surprised how much that actually helps. I might add in a couple pics of my own as well, and see if I can get this into the how-to section. I never could find a decent, well-explained article about this.
  6. CorCor67
    Offline

    CorCor67 Premium Member Premium Member Developer

    Joined:
    May 2, 2010
    Messages:
    438
    Likes Received:
    2
    Trophy Points:
    0
    You're welcome, I had the same difficulties before but got help from thebowers and pandroid. I was thinking about taking some time and making a "how to" thread myself after you asked this, I'm sure it would help others a lot.
  7. chevycam94
    Offline

    chevycam94 Steel Droid ROM Developer Developer

    Joined:
    May 12, 2010
    Messages:
    1,373
    Likes Received:
    13
    Trophy Points:
    38
    Location:
    Central Ohio
    Having trouble after saving them with the tool. Missing a line or two at the bottom of the image, and the two pixels that designate where the stretch area is, SHOW in the image after saving it.
Search tags for this page

.9.png files

,

.9 png

,
magnifying glass png
,
theme glass png