GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class
Members Example





In This Topic
GdViewer Class
In This Topic
The GdViewer class is designed to fully automate most viewing operations you require. The instance of this class can be used as an image viewer control to view supported files, images, PDF documents, as well as easily zoom, rotate, define display area, print or even create thumbnails of those loaded documents.

On the other hand, it can also be used as an interactive tool allowing you to add and edit solely GdPictureXMP annotations.

Syntax
'Declaration
 
<ToolboxBitmapAttribute(GdPicture14.GdViewer, "toolbox.bmp")>
<DesignerAttribute("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", System.ComponentModel.Design.IRootDesigner)>
<DesignerCategoryAttribute("UserControl")>
<DefaultEventAttribute("Load")>
<DefaultPropertyAttribute("Text")>
<DesignerSerializerAttribute("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>
<ToolboxItemFilterAttribute("System.Windows.Forms")>
Public NotInheritable Class GdViewer 
   Inherits System.Windows.Forms.UserControl
[ToolboxBitmap(GdPicture14.GdViewer, "toolbox.bmp")]
[Designer("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", System.ComponentModel.Design.IRootDesigner)]
[DesignerCategory("UserControl")]
[DefaultEvent("Load")]
[DefaultProperty("Text")]
[DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItemFilter("System.Windows.Forms")]
public sealed class GdViewer : System.Windows.Forms.UserControl 
public class GdViewer = class(System.Windows.Forms.UserControl)sealed; 
ToolboxBitmapAttribute(GdPicture14.GdViewer, "toolbox.bmp")
DesignerAttribute("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", System.ComponentModel.Design.IRootDesigner)
DesignerCategoryAttribute("UserControl")
DefaultEventAttribute("Load")
DefaultPropertyAttribute("Text")
DesignerSerializerAttribute("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
ToolboxItemFilterAttribute("System.Windows.Forms")
public sealed class GdViewer extends System.Windows.Forms.UserControl
[ToolboxBitmap(GdPicture14.GdViewer, "toolbox.bmp")]
[Designer("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", System.ComponentModel.Design.IRootDesigner)]
[DesignerCategory("UserControl")]
[DefaultEvent("Load")]
[DefaultProperty("Text")]
[DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItemFilter("System.Windows.Forms")]
public __gc __sealed class GdViewer : public System.Windows.Forms.UserControl 
[ToolboxBitmap(GdPicture14.GdViewer, "toolbox.bmp")]
[Designer("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", System.ComponentModel.Design.IRootDesigner)]
[DesignerCategory("UserControl")]
[DefaultEvent("Load")]
[DefaultProperty("Text")]
[DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItemFilter("System.Windows.Forms")]
public ref class GdViewer sealed : public System.Windows.Forms.UserControl 
Remarks
Please, be aware that GdViewer is developed to handle documents, specifically images, in read-only mode. As its name says, it is only a viewer by the definition. If you want to properly deal with images, for example, to rotate page and subsequently save the image, please use the GdPictureImaging class instead.

Please find some sample projects here to fully see, how to create, integrate and use the GdViewer control in your application.

Example
How to create and integrate the GdViewer control into your application.
'Define GdViewer object in your application.
Friend WithEvents GdViewer1 As GdViewer
            
'Create an instance.
GdViewer1 = New GdViewer()
            
'Set your preferred properties here.
GdViewer1.Name = "GdViewer1"
GdViewer1.SetBackgroundColor(GdViewer1.ARGBI(255, 245, 245, 220))
' ...
            
'Add to your application controls.
Controls.Add(GdViewer1)
            
'Probably the GdViewer1 instance is disposed of automatically in your application,
'but you can still do it this way.
'GdViewer1.Dispose()
//Define GdViewer object in your application.
internal GdViewer GdViewer1;
            
//Create an instance.
GdViewer1 = new GdViewer();
            
//Set your preferred properties here.
GdViewer1.Name = "GdViewer1";
GdViewer1.SetBackgroundColor(GdViewer1.ARGBI(255, 245, 245, 220));
// ...
            
//Add to your application controls.
Controls.Add(GdViewer1);
            
//Probably the GdViewer1 instance is disposed of automatically in your application,
//but you can still do it this way.
//GdViewer1.Dispose();
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            System.Windows.Forms.ScrollableControl
               System.Windows.Forms.ContainerControl
                  System.Windows.Forms.UserControl
                     GdPicture14.GdViewer

See Also