Created
June 22, 2015 08:47
-
-
Save YusukeIwaki/c4b06e21ab25adde2f1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
from PIL import Image, ImageDraw | |
import math | |
import os | |
os.system("mkdir -p drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi drawable-xxxhdpi") | |
def gen(scale,filename): | |
size=int(16*scale) | |
image = Image.new('RGBA', (size, size)) | |
draw = ImageDraw.Draw(image) | |
n=8 | |
for i in xrange(n): | |
a=size/2 | |
th=2*i*math.pi/n | |
x=a+(a-n/2)*math.cos(th) | |
y=a+(a-n/2)*math.sin(th) | |
r=scale*(i+1)/4 | |
draw.ellipse((x-r, y-r, x+r, y+r), fill = '#2473C5') | |
image.save(filename) | |
gen(1,"drawable-mdpi/ic_file_downloading_part.png") | |
gen(1.5,"drawable-hdpi/ic_file_downloading_part.png") | |
gen(2,"drawable-xhdpi/ic_file_downloading_part.png") | |
gen(3,"drawable-xxhdpi/ic_file_downloading_part.png") | |
gen(4,"drawable-xxxhdpi/ic_file_downloading_part.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment