Class IconImageParser
Functions for special thumbnail parsing
Inherited Members
Namespace: DuetControlServer.Files.ImageProcessing
Assembly: DuetControlServer.dll
Syntax
public static class IconImageParser
Methods
BinaryToImage(MemoryStream, out int, out int)
Takes a memory stream containing the header icon + the 4 size bytes
Declaration
public static Image BinaryToImage(MemoryStream ms, out int width, out int height)
Parameters
Type | Name | Description |
---|---|---|
MemoryStream | ms | memory stream containing the header icon + 4 size-bytes |
int | width | Width of the thumbnail |
int | height | Height of the thumbnail |
Returns
Type | Description |
---|---|
Image | Parsed image |
ProcessAsync(Stream, CodeParserBuffer, GCodeFileInfo, Code, bool)
Try to extract thumbnails from a given file
Declaration
public static ValueTask ProcessAsync(Stream stream, CodeParserBuffer codeParserBuffer, GCodeFileInfo parsedFileInfo, Code code, bool readThumbnailContent)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | Stream to read from |
CodeParserBuffer | codeParserBuffer | Read buffer |
GCodeFileInfo | parsedFileInfo | File information |
Code | code | Code instance to reuse |
bool | readThumbnailContent | Whether thumbnail content shall be returned |
Returns
Type | Description |
---|---|
ValueTask | Asynchronous task |
RGB2To3Bytes(int)
Convert two bytes compressed RGB to three bytes
Declaration
public static byte[] RGB2To3Bytes(int color)
Parameters
Type | Name | Description |
---|---|---|
int | color |
Returns
Type | Description |
---|---|
byte[] | [0]: Red, [1]: Green, [2]: Blue |