Indicates the optional name of the file to use as a hint when loading image data from memory streams.
public string Name {get; set;}
Public Property Name As String
public string Name {get; set;}
get_Name();
set_Name(value);
Object.defineProperty('Name');
The optional name of file to load. Default value is null.
Some file formats do not contain a well-defined file signature. This is especially true for document file formats (TXT, PST, etc.). LEADTOOLS can still detect the file format using the filename extension (ex. ".txt" or ".pst"). However, when loading files from memory streams (or if the extension of file on disk differs from the common one), the filename extension is not available. You can use this property to provide the RasterCodecs class with this information to use as a hint when loading the image data.
The value does not have to be the original file name, it can be any generic value such as "file.txt", RasterCodecs will then use the extension (in this case, .txt) as a hint if it cannot determine the file format from the data itself.
The value is not used and is ignored if the data contains image data with a well-defined file signature, such as TIFF, JPEG or PDF.
When loading a file from an HTTP stream, the MIME type is always available and the value can be passed to RasterCodecs.GetExtensionMimeType to obtain the extension to be used with Name. For example:
RasterCodecs rasterCodecs = new RasterCodecs();
WebRequest request = WebRequest.Create("http://myserver/mydata");
using (WebResponse response = request.GetResponse())
{
// Get the content type (MIME type)
string mimeType1 = request.ContentType;
// Get the corresponding file extension
String extension = RasterCodecs.GetMimeTypeExtension(mimeType);
// Use it as a hint to RasterCodecs when loading this image file
rasterCodecs.Options.Load.Name = "file." + extension;
// Now load the image from the stream
Stream stream = response.GetResponseStream();
rasterCodecs.Load(stream, 1);
}
Products |
Support |
Feedback: Name Property (CodecsLoadOptions) - Leadtools.Codecs |
Introduction |
Help Version 19.0.2017.6.16
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.