Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
a613ec70
Commit
a613ec70
authored
Jul 12, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 裁剪图片
parent
93572579
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
YHMyFileListViewController.swift
...e(服务中心)/FileList(文件清单)/C/YHMyFileListViewController.swift
+21
-10
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/FileList(文件清单)/C/YHMyFileListViewController.swift
View file @
a613ec70
...
...
@@ -437,19 +437,30 @@ extension YHMyFileListViewController {
@objc
func
clickSaveBtn
()
{
YHHUD
.
show
(
.
progress
(
message
:
"正在生成图片"
))
TYSnapshotScroll
.
screenSnapshot
(
self
.
tableView
)
{
[
weak
self
]
image
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
let
img
=
image
{
self
.
saveImage
(
img
)
}
else
{
YHHUD
.
flash
(
message
:
"生成图片失败"
)
let
originY
=
self
.
tableView
.
contentOffset
.
y
self
.
tableView
.
scrollToBottom
(
animated
:
false
)
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
,
execute
:
{
TYSnapshotScroll
.
screenSnapshot
(
self
.
tableView
)
{
[
weak
self
]
image
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
self
.
tableView
.
setContentOffset
(
CGPoint
(
x
:
0
,
y
:
originY
),
animated
:
false
)
if
let
img
=
image
{
// 裁剪
let
targetFrame
=
CGRectMake
(
0
,
k_Height_NavigationtBarAndStatuBar
-
30
,
img
.
size
.
width
,
img
.
size
.
height
-
k_Height_NavigationtBarAndStatuBar
)
let
croppedImage
=
img
.
cropped
(
to
:
targetFrame
)
self
.
saveImage
(
croppedImage
)
}
else
{
YHHUD
.
flash
(
message
:
"生成图片失败"
)
}
}
}
}
)
}
func
saveImage
(
_
image
:
UIImage
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment