Clipboard support is an essential part of every Windows component. Nevron Chart for .NET can place bitmap images in the clipboard with ease. This is achieved with the help of the CopyToClipboard function of the NImageExporter object. The function has two versions:
C# |
Copy Code
|
---|---|
public void CopyToClipboard(INImageFormat imageFormat) public void CopyToClipboard(NSize dimensions, NResolution resolution, INImageFormat imageFormat) |
Visual Basic |
Copy Code
|
---|---|
Public Sub CopyToClipboard(ByVal dimensions As NSize, ByVal resolution As NResolution, ByVal imageFormat As INImageFormat) Public Sub CopyToClipboard(ByVal imageFormat As INImageFormat) |
The first one exports a bitmap with the dimensions of the control in the form using the current screen resolution, whereas the second one uses the specified dimensions and resolution (passed as parameters). To specify the image format you have to create an instance of one of the types described in the Image Formats topic and pass it as a parameter of the function.
The following code will place a 200x200 true color bitmap image of the chart in the clipboard:
C# |
Copy Code
|
---|---|
chartControl.ImageExporter.CopyToClipboard(new NSize(200, 200), NResolution.ScreenResolution, new NBitmapImageFormat()); |
Visual Basic |
Copy Code
|
---|---|
chartControl.ImageExporter.CopyToClipboard(New NSize(200, 200), NResolution.ScreenResolution, New NBitmapImageFormat) |