matlab.net.http.io.ImageProvider Class
Namespace: matlab.net.http.io
Superclasses: matlab.net.http.io.ContentProvider
ContentProvider to send MATLAB image data
Description
Use an ImageProvider
object to convert and send MATLAB® image data in an HTTP RequestMessage
. This provider converts the
data to one of the standard types, as specified by the Content-Type of the request or
properties in this object. This provider also converts an image file to a different
format.
By default, if you specify an image Content-Type in the RequestMessage
, for
example "image/jpeg"
and RequestMessage.Body
is a
MessageBody
containing your image data, then MATLAB assumes that MessageBody.Data
is image data and tries to
convert it appropriately. To control how your data is converted, use an
ImageProvider
in RequestMessage.Body
.
If the RequestMessage
does not contain a Content-Type header field, then
this provider adds the appropriate image Content-Type to the header. Otherwise, the header
field is not modified and conversion is done as specified in the properties of this object,
even if its value is inconsistent with the Content-Type field.
The matlab.net.http.io.ImageProvider
class is a handle
class.
Creation
Description
provider = ImageProvider(
obtains the image data from the file filename
,arg1,...,argN
)filename
and sends it in the
format specified in arg1,...,argN
or the Content-Type field, setting
the Filename
property to filename
.
While this provider can convert a file in one format to data in another format, it is
not designed to send an image file as is. To send a file without changing its type, use a
FileProvider
.
Properties
Methods
More About
Version History
Introduced in R2018a
See Also
RequestMessage
| MessageBody
| ContentProvider
| FileProvider
| imwrite
| ImageConsumer