Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Muhammad Azeez
libvlcsharp-samples
Commits
8044c5c3
Commit
8044c5c3
authored
Jun 25, 2020
by
Martin Finkel
Browse files
thumbnail: update sample to new ImageSharp API
parent
c566ce83
Changes
1
Hide whitespace changes
Inline
Side-by-side
PreviewThumbnailExtractor/Program.cs
View file @
8044c5c3
...
...
@@ -3,6 +3,7 @@ using SixLabors.ImageSharp;
using
SixLabors.ImageSharp.Advanced
;
using
SixLabors.ImageSharp.Processing
;
using
System
;
using
System.Linq
;
using
System.Collections.Concurrent
;
using
System.IO
;
using
System.IO.MemoryMappedFiles
;
...
...
@@ -106,7 +107,7 @@ namespace PreviewThumbnailExtractor
using
(
var
image
=
new
Image
<
SixLabors
.
ImageSharp
.
PixelFormats
.
Bgra32
>((
int
)(
Pitch
/
BytePerPixel
),
(
int
)
Lines
))
using
(
var
sourceStream
=
file
.
file
.
CreateViewStream
())
{
sourceStream
.
Read
(
MemoryMarshal
.
AsBytes
(
image
.
GetPixelSpan
()
));
sourceStream
.
Read
(
MemoryMarshal
.
AsBytes
(
image
.
GetPixel
MemoryGroup
().
Single
().
Span
));
Console
.
WriteLine
(
$"Writing
{
frameNumber
:
0000
}
.jpg"
);
var
fileName
=
Path
.
Combine
(
destination
,
$"
{
frameNumber
:
0000
}
.jpg"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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