Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Client.Sample.ImageUploader.V4.5
Project
Overview
Details
Activity
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
陶然
Kivii.Client.Sample.ImageUploader.V4.5
Commits
5ec7e266
Commit
5ec7e266
authored
Jun 04, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图片旋转功能
parent
6945e4ec
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
FrmMain.Designer.cs
Src/FrmMain.Designer.cs
+0
-0
FrmMain.cs
Src/FrmMain.cs
+49
-1
No files found.
Src/FrmMain.Designer.cs
View file @
5ec7e266
This diff is collapsed.
Click to expand it.
Src/FrmMain.cs
View file @
5ec7e266
using
Kivii.Linq
;
using
Kivii.Imaging.Filters
;
using
Kivii.Imaging
;
using
Kivii.Linq
;
using
Kivii.Math.Geometry
;
using
Kivii.Messaging
;
using
Kivii.Messaging
;
using
Kivii.Sample.ImageUploader.Entities
;
using
Kivii.Sample.ImageUploader.Entities
;
using
Kivii.Video
;
using
Kivii.Video
;
...
@@ -117,6 +120,7 @@ namespace Kivii.Sample.ImageUploader
...
@@ -117,6 +120,7 @@ namespace Kivii.Sample.ImageUploader
btnReportId
.
Enabled
=
!
notLogin
;
btnReportId
.
Enabled
=
!
notLogin
;
btnShot
.
Enabled
=
!
notLogin
;
btnShot
.
Enabled
=
!
notLogin
;
btnDelete
.
Enabled
=
!
notLogin
;
btnDelete
.
Enabled
=
!
notLogin
;
btnEditor
.
Enabled
=
!
notLogin
;
btnLogout
.
Enabled
=
!
notLogin
;
btnLogout
.
Enabled
=
!
notLogin
;
if
(
notLogin
)
if
(
notLogin
)
...
@@ -719,6 +723,33 @@ namespace Kivii.Sample.ImageUploader
...
@@ -719,6 +723,33 @@ namespace Kivii.Sample.ImageUploader
picName
+=
DateTime
.
Now
.
ToString
(
"mmssfff"
);
picName
+=
DateTime
.
Now
.
ToString
(
"mmssfff"
);
var
photo
=
new
DbFile
(
bitmap
,
picName
);
var
photo
=
new
DbFile
(
bitmap
,
picName
);
//if (chbRectify.Checked)
//{
// Bitmap temp = photo.Image.Clone() as Bitmap;
// var _counter = new BlobCounter();
// _counter.FilterBlobs = true;
// _counter.MinWidth = photo.Image.Width / 4;
// _counter.MinHeight = photo.Image.Height / 4;
// FiltersSequence seq = new FiltersSequence();
// seq.Add(Grayscale.CommonAlgorithms.BT709); //First add grayScaling filter
// seq.Add(new OtsuThreshold()); //Then add binarization(thresholding) filter
// temp = seq.Apply(temp);
// _counter.ProcessImage(temp);
// temp.Dispose();
// var blobs = _counter.GetObjectsInformation();
// if (blobs != null && blobs.Length > 0)
// {
// var corners = PointsCloud.FindQuadrilateralCorners(_counter.GetBlobsEdgePoints(blobs[0]));
// var rect = blobs[0].Rectangle;
// QuadrilateralTransformation quadTransformer = new QuadrilateralTransformation();
// quadTransformer.SourceQuadrilateral = corners; //Set corners for transforming card
// quadTransformer.AutomaticSizeCalculaton = true;
// photo.Image = quadTransformer.Apply(photo.Image);
// //ResizeBilinear resizer = new ResizeBilinear(rect.Width, rect.Height);
// }
//}
addSnapshot
(
photo
);
addSnapshot
(
photo
);
Thread
.
Sleep
(
50
);
Thread
.
Sleep
(
50
);
showSnapshot
(
photo
);
showSnapshot
(
photo
);
...
@@ -734,7 +765,24 @@ namespace Kivii.Sample.ImageUploader
...
@@ -734,7 +765,24 @@ namespace Kivii.Sample.ImageUploader
MessageBox
.
Show
(
"没有找到视频采集设备"
);
MessageBox
.
Show
(
"没有找到视频采集设备"
);
}
}
}
}
private
void
btnCamearTurn_Click
(
object
sender
,
EventArgs
e
)
{
if
(
currentPhoto
==
null
)
return
;
if
(
currentPhoto
.
Image
==
null
)
return
;
int
index
=
0
;
var
photo
=
photos
.
FirstOrDefault
(
o
=>
o
.
Image
==
currentPhoto
.
Image
);
if
(
photo
!=
null
)
{
index
=
photos
.
IndexOf
(
photo
);
if
(
index
<=
-
1
)
index
=
0
;
deleteSnapshot
(
photo
);
}
currentPhoto
.
Image
.
RotateFlip
(
RotateFlipType
.
Rotate90FlipNone
);
var
editedPhoto
=
new
DbFile
(
currentPhoto
.
Image
,
currentPhoto
.
Name
);
addSnapshot
(
editedPhoto
,
index
);
showSnapshot
(
editedPhoto
);
}
private
void
PictureBox_Click
(
object
sender
,
EventArgs
e
)
private
void
PictureBox_Click
(
object
sender
,
EventArgs
e
)
{
{
// 获取点击的 PictureBox 中的图片
// 获取点击的 PictureBox 中的图片
...
...
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