[TOOL][WINDOWS][.PNG][.9.PNG] Android Drawable Resizer Tool

Search This thread

~RoN~

Member
Apr 3, 2013
32
79
[TOOL] Android Drawable Resizer Tool

Hi!

Can you count how many times you created a drawable for your app?
The answer is probably NO.
You opened your favorite image-editing software, designed a beautiful drawable, saved, and now of course, there's the simple but annoying thing, of resizing the drawable to fit every density.
No more! Android Drawable Resizer, replaces you in the last annoying part.
All you have to do, is to choose a drawable, tell the software which density does it belong to, choose the the res folder, and press Go!. The software will know how and where to place each resized drawable, with the correct name.


Requirements:
If you don't have a .NET Framework installed, download and install this:
http://msdn.microsoft.com/en-us/vstudio/aa496123

Instructions:

1. Download the zip file.
2. Extract it including the .dll file.
3. Run the .exe file.
*Note: Both files need to be in the same place in order to activate the program!
4. Choose the source drawable density
5. Choose the drawable you want to resize
6. Choose which densities you want to export to
7. Choose the destination folder. The program will create a folder for each density selected (if the folder doesn't exist), and then insert the resized drawables to their right place
8. Press Go!
9. Enjoy!
10. Hit the Thanks button, or even donate for my work :eek:

Current Version: 1.1.3.0
From XDA: View attachment 1904989
Or from dev-host - Here

Screenshot:

50934020.png


To do:

--->Change the selected drawables gallery (If you know of a free control for that, please P.M me) In progress
--->Adding the abillity to decompile-->resize-->recompile .9.png files In progress

--->Translation to more languages Not in the next version

Credits:
--->ComponentFactory Krypton 4.4.0 great .NET library
 
Last edited:

~RoN~

Member
Apr 3, 2013
32
79
Changelog:

Version 1.1.3.0
[+]Fixed all known bugs
[+]Added xxhdpi density
Version 1.1.2.3
[+]Fixed bug of pictures being resized from a wrong size in some circumstances.
Version 1.1.2.2
[+]Solved the exception thrown when the server CPU limit was reached
[--]Replaced the drawables gallery because I didn't know the previous one is not free. Sorry! :eek:
Version 1.1.2.1
[+]Added multiple-choice exporting
[+]Changed manual mode behavior
[+]Added in-app update, so you won't need to download each version from xda
[+]Application crash problem fixed.
Version 1.1.1.0
[+] Added .9.png files support
[--] Removed support for jpg , gif , bmp files. Maybe will return in the future.
Version 1.1.0.0
Initial Release
 
Last edited:
  • Like
Reactions: BeansTown106

rjunraj

Senior Member
Apr 4, 2012
1,110
355
33
surat
can v somehow resize .9.png files ?
and one more question
i am making an app everything is fine ,but if i use this app in other phones the ui remains the same size
is there any way to change height and width in xml ,all at same time ,
thanks in advance

Sent from my MI355 using Xparent Cyan Tapatalk 2
 

~RoN~

Member
Apr 3, 2013
32
79
can v somehow resize .9.png files ?
and one more question
i am making an app everything is fine ,but if i use this app in other phones the ui remains the same size
is there any way to change height and width in xml ,all at same time ,
thanks in advance

Sent from my MI355 using Xparent Cyan Tapatalk 2

Yes, I have just created a new version that supports .9.png files.
As for your second question, you shouldn't hardcode sizes in the layout file. You should use different drawables for each density.
You can use my application to do this easily, but you should also read this entry in the android API guides:
Supporting Multiple Screens
Need framewoek 3 or 3.5?

Need framework 2 :p
 
  • Like
Reactions: BeansTown106

OJ

Senior Member
Dec 31, 2011
495
469
Pune
GREAT!

Great work! Best thing is .9 png support. Very good...
I will try it tomorrow..
 

~RoN~

Member
Apr 3, 2013
32
79
Soon I will upload a version which supports automatic bug reporting. Please if the application crashes, send me the details :eek:
 
  • Like
Reactions: BeansTown106

santod040

Recognized Developer / Recognized Contributor
Nov 7, 2008
12,569
23,612
NorCal
Let me know if you need more: CRASH DUMP (temp file)
Crashes when trying to run.
Code:
<Parameter8>System.IO.FileNotFoundException</Parameter8>

Thank you for your efforts on this handy tool. :)
 

~RoN~

Member
Apr 3, 2013
32
79
Let me know if you need more: CRASH DUMP (temp file)
Crashes when trying to run.
Code:
<Parameter8>System.IO.FileNotFoundException</Parameter8>

Thank you for your efforts on this handy tool. :)

Solved it, I was stupid enough to not include a dll file. :silly:

I uploaded a new version. The zip now contains two files.
Both files need to be in the same place in order to activate the program!
 

santod040

Recognized Developer / Recognized Contributor
Nov 7, 2008
12,569
23,612
NorCal
Solved it, I was stupid enough to not include a dll file. :silly:

I uploaded a new version. The zip now contains two files.
Both files need to be in the same place in order to activate the program!

Thanks! Works now!
Much appreciated for the prompt response and fix.
Now if I may make a couple requests/suggestions.
It would be great to be able to choose multiple files(select all) when browsing for images to resize(for batch processing)
As it takes a while to do each one individually, but not as long as resizing manually, so that's a plus!
Maybe that is something I am overlooking on my end to enable that in that selection window.
Other thing I noticed was with the destination density:
I assumed that selecting a destination density would then give me that resolution as output.
I quickly found out, that was the opposite of how it works.
The density I chose was the only one not produced/resized, so essentially they are all enabled by default and the selection is to omit or remove a density from the process.
That's fine I suppose, just a little reverse of what I initially thought.
Maybe it would be better to only output the densities selected, I don't know, small detail I guess.
The last thing was that I noticed it tags each image name with it's density in the image name.
That requires a lot of renaming if doing many images.
Seems maybe if they output to relevant resolution folders, they would not have to be renamed at all.
Again, maybe this was my fault, due to using an output folder and not leaving it to do it's default thing, but I don't think that's the case.

Thanks again for your efforts on this.
I could see this becoming very useful, keep up the great work! :good:
 
  • Like
Reactions: ~RoN~

~RoN~

Member
Apr 3, 2013
32
79
Thanks! Works now!
Much appreciated for the prompt response and fix.
Now if I may make a couple requests/suggestions.
It would be great to be able to choose multiple files(select all) when browsing for images to resize(for batch processing)
As it takes a while to do each one individually, but not as long as resizing manually, so that's a plus!
Maybe that is something I am overlooking on my end to enable that in that selection window.
Other thing I noticed was with the destination density:
I assumed that selecting a destination density would then give me that resolution as output.
I quickly found out, that was the opposite of how it works.
The density I chose was the only one not produced/resized, so essentially they are all enabled by default and the selection is to omit or remove a density from the process.
That's fine I suppose, just a little reverse of what I initially thought.
Maybe it would be better to only output the densities selected, I don't know, small detail I guess.
The last thing was that I noticed it tags each image name with it's density in the image name.
That requires a lot of renaming if doing many images.
Seems maybe if they output to relevant resolution folders, they would not have to be renamed at all.
Again, maybe this was my fault, due to using an output folder and not leaving it to do it's default thing, but I don't think that's the case.

Thanks again for your efforts on this.
I could see this becoming very useful, keep up the great work! :good:

First, I'm glad it now works.
Second, Thank you for the suggestions. About the multi-select, it have been in my to-do list since the beginning.
About the images renaming, you are absolutely right, especially after multi-select will be supported...
I am starting to work on that right now. Probably tomorrow there will be new version:fingers-crossed:
Update: I am almost done, and it looks really good :victory:
 
Last edited:

santod040

Recognized Developer / Recognized Contributor
Nov 7, 2008
12,569
23,612
NorCal
First, I'm glad it now works.
Second, Thank you for the suggestions. About the multi-select, it have been in my to-do list since the beginning.
About the images renaming, you are absolutely right, especially after multi-select will be supported...
I am starting to work on that right now. Probably tomorrow there will be new version:fingers-crossed:
Update: I am almost done, and it looks really good :victory:

Keep up the great work!
Already a very useful tool, and is headed towards becoming really great! :good:
Don't stop and thanks again for the prompt response.
 

~RoN~

Member
Apr 3, 2013
32
79
Keep up the great work!
Already a very useful tool, and is headed towards becoming really great! :good:
Don't stop and thanks again for the prompt response.
You can look at my progress in the first page in the To-Do section.
I am currently testing the new features, and already working on new ones :D

Update: I finished the version. Many features added!
 

Attachments

  • Untitled45.png
    Untitled45.png
    26 KB · Views: 163
Last edited:

the1dynasty

Senior Member
Dec 16, 2011
4,336
3,164
Sweet... This should help out tons... Especially for this new app I'm making! Thanks for sharing!

Sent from my Nexus S 4G using Tapatalk 2
 

BeansTown106

Inactive Recognized Developer
Dec 22, 2011
3,694
54,414
BeanTown USA
thanks a bunch needed something like this to help transfer my s3/n2 theming into my note 10.1 rom :) this seems like it will be perfect for the job any chance of a linux version in the future? if not no biggie thats what vm's are for
 

regaw_leinad

Inactive Recognized Developer
Jan 30, 2010
3,667
3,787
Seattle, WA
www.regawmod.com
Looks awesome! Good work! That being said, you should probably be careful distributing the ComponentFactory.Krypton.Ribbon.dll because it's not free and you use it's KryptonGallery control... But I'm not judging lol. Just be careful! :)

Also, I think you should put in some exception handling for your updating. Your web host's server's CPU limit was reached and nothing can connect to it right now, thus throwing an ArgumentOutOfRangeException when it tries to parse the downloaded update info.

You could also check out my .NET updater tutorial on YouTube if you want to implement that into this project - HERE
 
Last edited:
  • Like
Reactions: docsparks

frenzyboi

Senior Member
May 11, 2012
866
762
A great app for developers! Would need this for a widget of mine ^^

Anyway, on startup, I received an error.
Length cannot be less than zero.
Parameter name: length
Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at Android_Drawables_Resizer.Main.wc_DownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5466 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
Android Drawables Resizer
    Assembly Version: 1.1.2.1
    Win32 Version: 1.1.2.1
    CodeBase: file:///C:/Users/Administrator/Dropbox/android/Tools/Android_Drawable_Resizer_1.1.2.1/Android%20Drawables%20Resizer.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
ComponentFactory.Krypton.Toolkit
    Assembly Version: 4.4.0.0
    Win32 Version: 4.4.0.0
    CodeBase: file:///C:/Users/Administrator/Dropbox/android/Tools/Android_Drawable_Resizer_1.1.2.1/ComponentFactory.Krypton.Toolkit.DLL
----------------------------------------
ComponentFactory.Krypton.Ribbon
    Assembly Version: 4.4.0.0
    Win32 Version: 4.4.0.0
    CodeBase: file:///C:/Users/Administrator/Dropbox/android/Tools/Android_Drawable_Resizer_1.1.2.1/ComponentFactory.Krypton.Ribbon.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 63
    [TOOL] Android Drawable Resizer Tool

    Hi!

    Can you count how many times you created a drawable for your app?
    The answer is probably NO.
    You opened your favorite image-editing software, designed a beautiful drawable, saved, and now of course, there's the simple but annoying thing, of resizing the drawable to fit every density.
    No more! Android Drawable Resizer, replaces you in the last annoying part.
    All you have to do, is to choose a drawable, tell the software which density does it belong to, choose the the res folder, and press Go!. The software will know how and where to place each resized drawable, with the correct name.


    Requirements:
    If you don't have a .NET Framework installed, download and install this:
    http://msdn.microsoft.com/en-us/vstudio/aa496123

    Instructions:

    1. Download the zip file.
    2. Extract it including the .dll file.
    3. Run the .exe file.
    *Note: Both files need to be in the same place in order to activate the program!
    4. Choose the source drawable density
    5. Choose the drawable you want to resize
    6. Choose which densities you want to export to
    7. Choose the destination folder. The program will create a folder for each density selected (if the folder doesn't exist), and then insert the resized drawables to their right place
    8. Press Go!
    9. Enjoy!
    10. Hit the Thanks button, or even donate for my work :eek:

    Current Version: 1.1.3.0
    From XDA: View attachment 1904989
    Or from dev-host - Here

    Screenshot:

    50934020.png


    To do:

    --->Change the selected drawables gallery (If you know of a free control for that, please P.M me) In progress
    --->Adding the abillity to decompile-->resize-->recompile .9.png files In progress

    --->Translation to more languages Not in the next version

    Credits:
    --->ComponentFactory Krypton 4.4.0 great .NET library
    3
    Keep up the great work!
    Already a very useful tool, and is headed towards becoming really great! :good:
    Don't stop and thanks again for the prompt response.
    You can look at my progress in the first page in the To-Do section.
    I am currently testing the new features, and already working on new ones :D

    Update: I finished the version. Many features added!
    2
    Is this compatible with xxhdpi
    Sent from my 5th Dimension eVo 3D
    *Team 420 band of Misfits*
    Not yet, I will soon add it. It is quite simple
    So this software can resize .9.PNGs without any errors?? With the placers at the correct positions??
    Yes. There shouldn't be any problems. The software refer to .9.PNGs as regular PNGs, and it just scales the images. The placers' positions shouldn't change.
    2
    Let me know if you need more: CRASH DUMP (temp file)
    Crashes when trying to run.
    Code:
    <Parameter8>System.IO.FileNotFoundException</Parameter8>

    Thank you for your efforts on this handy tool. :)

    Solved it, I was stupid enough to not include a dll file. :silly:

    I uploaded a new version. The zip now contains two files.
    Both files need to be in the same place in order to activate the program!
    2
    Thanks! Works now!
    Much appreciated for the prompt response and fix.
    Now if I may make a couple requests/suggestions.
    It would be great to be able to choose multiple files(select all) when browsing for images to resize(for batch processing)
    As it takes a while to do each one individually, but not as long as resizing manually, so that's a plus!
    Maybe that is something I am overlooking on my end to enable that in that selection window.
    Other thing I noticed was with the destination density:
    I assumed that selecting a destination density would then give me that resolution as output.
    I quickly found out, that was the opposite of how it works.
    The density I chose was the only one not produced/resized, so essentially they are all enabled by default and the selection is to omit or remove a density from the process.
    That's fine I suppose, just a little reverse of what I initially thought.
    Maybe it would be better to only output the densities selected, I don't know, small detail I guess.
    The last thing was that I noticed it tags each image name with it's density in the image name.
    That requires a lot of renaming if doing many images.
    Seems maybe if they output to relevant resolution folders, they would not have to be renamed at all.
    Again, maybe this was my fault, due to using an output folder and not leaving it to do it's default thing, but I don't think that's the case.

    Thanks again for your efforts on this.
    I could see this becoming very useful, keep up the great work! :good:

    First, I'm glad it now works.
    Second, Thank you for the suggestions. About the multi-select, it have been in my to-do list since the beginning.
    About the images renaming, you are absolutely right, especially after multi-select will be supported...
    I am starting to work on that right now. Probably tomorrow there will be new version:fingers-crossed:
    Update: I am almost done, and it looks really good :victory: