This repository has been archived on 2023-09-06. You can view files and clone it, but cannot push or open issues/pull-requests.
yutent
/
py-gtk-notes
Archived
1
0
Fork 0
master
yutent 2023-07-28 17:54:59 +08:00
parent 89ce9d1c3e
commit a961b87960
1 changed files with 7 additions and 6 deletions

View File

@ -21,14 +21,15 @@ def get_monitor_info(monitor):
def pixbuf_to_dict(pixbuf, filename = ''): def pixbuf_to_dict(pixbuf, filename = ''):
has_alpha = pixbuf.get_has_alpha()
# 没有apha通道时, get_pixels() 得到像素矩阵会出现极个别像素出现alpha通道
# 所以, 这里强制设置alpha通道为false, 补全像素矩阵的数据
if not has_alpha:
pixbuf = pixbuf.add_alpha(False, 0, 0, 0)
if pixbuf: if pixbuf:
has_alpha = pixbuf.get_has_alpha()
# 没有apha通道时, get_pixels() 得到像素矩阵会出现极个别像素出现alpha通道
# 所以, 这里强制设置alpha通道为false, 补全像素矩阵的数据
if not has_alpha:
pixbuf = pixbuf.add_alpha(False, 0, 0, 0)
image = { image = {
"width": pixbuf.get_width(), "width": pixbuf.get_width(),
"height": pixbuf.get_height(), "height": pixbuf.get_height(),