点九图转换程序

点9图简介?---点9图就是安卓系统内的一种可拉抻而不失真的图,点9图是把图中某些部分进行拉伸,而不想拉伸的部分,比如圆角等部分不做变化  参考博客:https://blog.csdn.net/gdutxiaoxu/article/details/100998987


电脑中需安装aapt工具
安装了python的话可以在桌面新建一个文件夹“点九图转换 ”讲点九图放在文件夹中,运行以下脚本即可装换
 

import os

path = r'C:\Users\TANG-GUO\Desktop\点九图转换'
docu = os.listdir(path)
print(docu)
des = input('请重命名后的输入聊天气泡描述:')
count = 0
def order(des,num):
    road = 'C:\\Users\\TANG-GUO\\Desktop\\点九图转换'
    order1 = ' & aapt s -i '+file[num] + ' -o ' + str(des) +'.png'
    enter1 = ''.join(['cd ' + road, order1])
    print(enter1)
    return(enter1)
for file in docu:
    old_dir = os.path.join(path, file)
    count += 1
    if os.path.isdir(old_dir):
        continue
    if '2x' in file:
        new_dir = os.path.join(path, des +'2x.9.png')
        os.rename(old_dir, new_dir)
    if '3x' in file:
        new_dir = os.path.join(path, des +'3x.9.png')
        os.rename(old_dir, new_dir)
print("一共重名了" + str(count) + "个文件")


file = list(os.listdir(path))
for i in file:
    print(i)
    if '2x' in i:
        m = os.popen(order(str(des)+'_2x',0), "r")
        output = m.read()
        print(output)

    if '3x' in i:
        n = os.popen(order(str(des)+'_3x',1), "r")
        output1 = n.read()
        print(output1)
```

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值