整理图片例子目录
|
@ -40,10 +40,10 @@ encoding//\u56FE\u5F62\u89C6\u56FE/\u6DFB\u52A0QWidget.py=utf-8
|
|||
encoding//\u56FE\u5F62\u89C6\u56FE/\u7B80\u5355\u56FE\u50CF\u5904\u7406/SimpleImagePs.py=utf-8
|
||||
encoding//\u56FE\u5F62\u89C6\u56FE/\u7B80\u5355\u56FE\u50CF\u5904\u7406/SimpleImageThread.py=utf-8
|
||||
encoding//\u56FE\u5F62\u89C6\u56FE/\u7B80\u5355\u56FE\u50CF\u5904\u7406/SimpleImageView.py=utf-8
|
||||
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/LoadImage.py=utf-8
|
||||
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/SlippedImgWidget.py=utf-8
|
||||
encoding//\u56FE\u7247/\u4EFF\u7F51\u9875\u56FE\u7247\u9519\u4F4D\u7279\u6548.py=utf-8
|
||||
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/res_rc.py=utf-8
|
||||
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/xpmres.py=utf-8
|
||||
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/\u56FE\u7247\u52A0\u8F7D.py=utf-8
|
||||
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/pyd\u7248\u672C/QtNinePatch/sip/configure.py=utf-8
|
||||
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/pyd\u7248\u672C/QtNinePatch/sip/testQtNinePatch.py=utf-8
|
||||
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/\u7EAFpython\u7248\u672C1/NinePatch.py=utf-8
|
||||
|
|
31
图片/README.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# 图片
|
||||
|
||||
## [1、图片加载](图片加载/)
|
||||
通过3种方式加载图片文件和显示gif图片
|
||||
|
||||
1. 通过QPixmap("xxx.jpg")加载
|
||||
2. 通过pyrcc5转换res.qrc为res_rc.py文件,可以直接import加载
|
||||
1. 转换命令pyrcc5 res.qrc -o res_rc.py
|
||||
2. import res_rc
|
||||
3. 此时可以通过QPixmap(":/images/head.jpg")来加载
|
||||
3. 通过rcc命令转成为二进制文件res.rcc
|
||||
1. 转换命令tools/rcc.exe -binary res2.qrc -o res.rcc
|
||||
2. 这里把资源前缀修改下(/myfile),见res2.qrc文件
|
||||
3. 通过QResource.registerResource("res.rcc")注册
|
||||
4. 此时可以通过QPixmap(":/myfile/images/head.jpg")来加载
|
||||
4. 通过xpm数组加载
|
||||
1. 通过工具tools/Image2XPM.exe来转换
|
||||
2. 这里把转换的xpm数组直接放到py文件中当做一个变量
|
||||
3. 见xpmres.py中的image_head
|
||||
4. 此时可以通过QPixmap(image_head)来加载
|
||||
5. 通过QMovie加载gif图片
|
||||
|
||||
![截图](图片加载/ScreenShot/图片加载.gif)
|
||||
|
||||
## [2、仿网页图片错位特效](仿网页图片错位特效.py)
|
||||
![截图](ScreenShot/仿网页图片错位特效.gif)![截图](ScreenShot/仿网页图片错位特效2.gif)
|
||||
|
||||
## [3、显示.9格式图片](显示.9格式图片/)
|
||||
详情见子目录[显示.9格式图片](显示.9格式图片/)里
|
||||
|
||||
![截图](显示.9格式图片/ScreenShot/显示.9格式图片.gif)
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 248 KiB |
Before Width: | Height: | Size: 413 KiB After Width: | Height: | Size: 413 KiB |
|
@ -22,11 +22,4 @@
|
|||
5. 通过QMovie加载gif图片
|
||||
|
||||
# 截图
|
||||
![截图](ScreenShot/1.gif)
|
||||
|
||||
|
||||
### 二、仿网页中的一个图片特效
|
||||
[SlippedImgWidget.py](SlippedImgWidget.py)
|
||||
|
||||
# 截图
|
||||
![SlippedImgWidget](ScreenShot/3.gif)
|
||||
![截图](ScreenShot/1.gif)
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
|
@ -48,6 +48,4 @@ qt_path = 'D:/soft/Qt/Qt5.5.1/5.5/msvc2010'
|
|||
|
||||
5、python configure.py
|
||||
|
||||
# 截图
|
||||
|
||||
![截图1](ScreenShot/1.gif)
|
||||
![截图](ScreenShot/1.gif)
|
||||
|
|
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 290 KiB |