-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MyImage 控件 #4868
MyImage 控件 #4868
Conversation
修改了下实现方式,支持 WebP 的同时支持使用 Base64 编码的图片 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
又研究了下,这个实现思路不行,在 UI 线程进行网络请求下载图片是不能接受的……
或许需要在 MyImage 中先把 Source 设置为空,然后后台进行网络请求,在下载结束后再把 Byte() 传给 MyBitmap 进行加载?
考虑放上一个“加载中”图片? |
''' <summary> | ||
''' 是否使用缓存,需要先于 Source 属性设置,否则无效 | ||
''' </summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要注册为 DependencyProperty。
默认值为 True。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我改完了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emmmm 似乎是 WPF 的特性?
新改后的代码测试发现顺序还是会影响实际结果……
使用下面代码很显然是期望不触发缓存机制,但是却使用了缓存
<local:MyImage Source="https://objects.lihaoyu.cn/bigcake-blog-images/2024/10/05/6700c8f7cd4b2.jpeg" EnableCache="False"/>
将 EnableCache
属性移到前面才会正常工作……
<local:MyImage EnableCache="False" Source="https://objects.lihaoyu.cn/bigcake-blog-images/2024/10/05/6700c8f7cd4b2.jpeg" />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修了,等更新的时候再推送 :D
Co-Authored-By: 龙腾猫跃 <[email protected]>
支持加载本地和在线 WebP 的图片控件,适配之后的帮助库图片格式变更
需要帮助解决在使用缓存时
UseCache
属性应当先于Source
属性设置才可以生效的问题代码写的非常不怎么样相关 Issue LTCatt/PCL2Help#393