From 5a56bab3e334b1a6fb5b9b81e10881b801136caf Mon Sep 17 00:00:00 2001 From: Irony <892768447@qq.com> Date: Fri, 2 Nov 2018 17:17:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=9B=BE=E7=89=87=E4=BE=8B?= =?UTF-8?q?=E5=AD=90=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .settings/org.eclipse.core.resources.prefs | 4 +-- 图片/README.md | 31 ++++++++++++++++++ .../3.gif => ScreenShot/仿网页图片错位特效.gif} | Bin .../2.gif => ScreenShot/仿网页图片错位特效2.gif} | Bin 图片/{图片加载 => }/images/bg.png | Bin 图片/{图片加载 => }/images/bg1.jpg | Bin 图片/{图片加载 => }/images/fg.png | Bin 图片/{图片加载 => }/images/fg1.png | Bin .../SlippedImgWidget.py => 仿网页图片错位特效.py} | 0 图片/图片加载/README.md | 9 +---- .../图片加载/ScreenShot/{1.gif => 图片加载.gif} | Bin 图片/图片加载/{LoadImage.py => 图片加载.py} | 0 图片/显示.9格式图片/README.md | 4 +-- .../ScreenShot/{1.gif => 显示.9格式图片.gif} | Bin 14 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 图片/README.md rename 图片/{图片加载/ScreenShot/3.gif => ScreenShot/仿网页图片错位特效.gif} (100%) rename 图片/{图片加载/ScreenShot/2.gif => ScreenShot/仿网页图片错位特效2.gif} (100%) rename 图片/{图片加载 => }/images/bg.png (100%) rename 图片/{图片加载 => }/images/bg1.jpg (100%) rename 图片/{图片加载 => }/images/fg.png (100%) rename 图片/{图片加载 => }/images/fg1.png (100%) rename 图片/{图片加载/SlippedImgWidget.py => 仿网页图片错位特效.py} (100%) rename 图片/图片加载/ScreenShot/{1.gif => 图片加载.gif} (100%) rename 图片/图片加载/{LoadImage.py => 图片加载.py} (100%) rename 图片/显示.9格式图片/ScreenShot/{1.gif => 显示.9格式图片.gif} (100%) diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 1d8fd02..81fe974 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -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 diff --git a/图片/README.md b/图片/README.md new file mode 100644 index 0000000..de9be2e --- /dev/null +++ b/图片/README.md @@ -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) \ No newline at end of file diff --git a/图片/图片加载/ScreenShot/3.gif b/图片/ScreenShot/仿网页图片错位特效.gif similarity index 100% rename from 图片/图片加载/ScreenShot/3.gif rename to 图片/ScreenShot/仿网页图片错位特效.gif diff --git a/图片/图片加载/ScreenShot/2.gif b/图片/ScreenShot/仿网页图片错位特效2.gif similarity index 100% rename from 图片/图片加载/ScreenShot/2.gif rename to 图片/ScreenShot/仿网页图片错位特效2.gif diff --git a/图片/图片加载/images/bg.png b/图片/images/bg.png similarity index 100% rename from 图片/图片加载/images/bg.png rename to 图片/images/bg.png diff --git a/图片/图片加载/images/bg1.jpg b/图片/images/bg1.jpg similarity index 100% rename from 图片/图片加载/images/bg1.jpg rename to 图片/images/bg1.jpg diff --git a/图片/图片加载/images/fg.png b/图片/images/fg.png similarity index 100% rename from 图片/图片加载/images/fg.png rename to 图片/images/fg.png diff --git a/图片/图片加载/images/fg1.png b/图片/images/fg1.png similarity index 100% rename from 图片/图片加载/images/fg1.png rename to 图片/images/fg1.png diff --git a/图片/图片加载/SlippedImgWidget.py b/图片/仿网页图片错位特效.py similarity index 100% rename from 图片/图片加载/SlippedImgWidget.py rename to 图片/仿网页图片错位特效.py diff --git a/图片/图片加载/README.md b/图片/图片加载/README.md index dc91f5e..5b588b3 100644 --- a/图片/图片加载/README.md +++ b/图片/图片加载/README.md @@ -22,11 +22,4 @@ 5. 通过QMovie加载gif图片 # 截图 -![截图](ScreenShot/1.gif) - - -### 二、仿网页中的一个图片特效 -[SlippedImgWidget.py](SlippedImgWidget.py) - -# 截图 -![SlippedImgWidget](ScreenShot/3.gif) \ No newline at end of file +![截图](ScreenShot/1.gif) \ No newline at end of file diff --git a/图片/图片加载/ScreenShot/1.gif b/图片/图片加载/ScreenShot/图片加载.gif similarity index 100% rename from 图片/图片加载/ScreenShot/1.gif rename to 图片/图片加载/ScreenShot/图片加载.gif diff --git a/图片/图片加载/LoadImage.py b/图片/图片加载/图片加载.py similarity index 100% rename from 图片/图片加载/LoadImage.py rename to 图片/图片加载/图片加载.py diff --git a/图片/显示.9格式图片/README.md b/图片/显示.9格式图片/README.md index c42bca5..aaebb44 100644 --- a/图片/显示.9格式图片/README.md +++ b/图片/显示.9格式图片/README.md @@ -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) diff --git a/图片/显示.9格式图片/ScreenShot/1.gif b/图片/显示.9格式图片/ScreenShot/显示.9格式图片.gif similarity index 100% rename from 图片/显示.9格式图片/ScreenShot/1.gif rename to 图片/显示.9格式图片/ScreenShot/显示.9格式图片.gif