Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dark_Zane
DataEditorX
Commits
60cdaa83
Commit
60cdaa83
authored
Jun 09, 2022
by
JoyJ
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Avalon' of
https://code.mycard.moe/nanahira/DataEditorX
parents
a12bf0bc
807915a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
13 deletions
+33
-13
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+33
-13
No files found.
DataEditorX/DataEditForm.cs
View file @
60cdaa83
...
...
@@ -1485,32 +1485,45 @@ void SaveAsMSE(bool onlyselect)
#
endregion
#
region
导入卡图
void
ImportImageFromSelect
()
void
ImportImageFromSelect
(
bool
fromClipboard
=
false
)
{
string
tid
=
this
.
tb_cardcode
.
Text
;
if
(
tid
==
"0"
||
tid
.
Length
==
0
)
{
return
;
}
using
(
OpenFileDialog
dlg
=
new
OpenFileDialog
())
if
(
fromClipboard
&&
Clipboard
.
ContainsImage
())
{
dlg
.
Title
=
LanguageHelper
.
GetMsg
(
LMSG
.
SelectImage
)
+
"-"
+
this
.
tb_cardname
.
Text
;
try
{
dlg
.
Filter
=
LanguageHelper
.
GetMsg
(
LMSG
.
ImageType
);
}
catch
{
}
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
this
.
ImportImage
(
Clipboard
.
GetImage
(),
tid
);
}
else
{
using
(
OpenFileDialog
dlg
=
new
OpenFileDialog
())
{
//dlg.FileName;
this
.
ImportImage
(
dlg
.
FileName
,
tid
);
dlg
.
Title
=
LanguageHelper
.
GetMsg
(
LMSG
.
SelectImage
)
+
"-"
+
this
.
tb_cardname
.
Text
;
try
{
dlg
.
Filter
=
LanguageHelper
.
GetMsg
(
LMSG
.
ImageType
);
}
catch
{
}
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
//dlg.FileName;
this
.
ImportImage
(
dlg
.
FileName
,
tid
);
}
}
}
}
private
void
pl_image_DoubleClick
(
object
sender
,
EventArgs
e
)
{
this
.
ImportImageFromSelect
();
if
(
ModifierKeys
.
Equals
(
Keys
.
Shift
))
{
this
.
ImportImageFromSelect
(
true
);
}
else
{
this
.
ImportImageFromSelect
();
}
}
void
Pl_imageDragDrop
(
object
sender
,
DragEventArgs
e
)
{
...
...
@@ -1538,6 +1551,13 @@ private void menuitem_importmseimg_Click(object sender, EventArgs e)
this
.
menuitem_importmseimg
.
Checked
=
!
this
.
menuitem_importmseimg
.
Checked
;
this
.
SetImage
(
tid
);
}
void
ImportImage
(
Image
image
,
string
tid
)
{
string
file
=
"temp"
+
new
Random
().
Next
(
10000000
,
99999999
)
+
".jpg"
;
image
.
Save
(
file
);
ImportImage
(
file
,
tid
);
File
.
Delete
(
file
);
}
void
ImportImage
(
string
file
,
string
tid
)
{
string
f
;
...
...
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