The type of the generated image is defined by the object contained in the ImageFormat property of the NImageResponse object. It can be one of the following:
| Class | Image Type | Available options |
|---|---|---|
| NBitmapImageFormat | Windows Bitmap | Bits per pixel |
| NGifImageFormat | GIF | Bits per pixel |
| NJpegImageFormat | JPEG | Bits per pixel, quality |
| NPngImageFormat | PNG | Bits per pixel |
| NTiffImageFormat | TIFF | Bits per pixel |
| NSvgImageFormat | SVG | Compress, EmbedImagesInSvg, EmbeddedImageFormat AddSvgHeader, EnableInteractivity, CustomScript |
The following code will change the default response type to true color JPEG with quality parameter set to 90 percent:
| C# |
Copy Code
|
|---|---|
NImageResponse imageResponse = new NImageResponse(); NJpegImageFormat jpegImageFormat = new NJpegImageFormat(); jpegImageFormat.Quality = 90; jpegImageFormat.PixelFormat = PixelFormat.Format32bppArgb; imageResponse.ImageFormat = jpegImageFormat; //[theComponent] is a valid instance of either NChartControl or NDrawingView [theComponent].ServerSettings.BrowserResponseSettings.DefaultResponse = imageResponse; |
|
| Visual Basic |
Copy Code
|
|---|---|
Dim imageResponse As New NImageResponse Dim jpegImageFormat As New NJpegImageFormat jpegImageFormat.Quality = 90 jpegImageFormat.PixelFormat = PixelFormat.Format32bppArgb imageResponse.ImageFormat = jpegImageFormat '[theComponent] is a valid instance of either NChartControl or NDrawingView [theComponent].ServerSettings.BrowserResponseSettings.DefaultResponse = imageResponse |
|