Image Viewer CP Pro SDK ActiveX

Image Viewer CP Pro SDK ActiveX

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

It is a PDF Viewer and Document Viewer SDK , Export to PDF ,Image processing, 1D and 2D Barcode Reader, Writer, DICOM and OCR with C#, C++, VB.NET , VB, Delphi, Vfp, MS Access.

Popular Solution Go   Back

C# - How to create image viewer application in C#

Step 1: To install the Image Viewer CP Pro ActiveX Control, begin by launching the setup file (http://www.viscomsoft.com/demo/imageviewercpprosetup.exe). Select the desired installation folder for the Image Viewer CP Pro ActiveX and continue with the installation on your development computer.

Step 2: Create New Visual C# Project, select Windows Forms Application.



Step 3: The next step is to install Image Viewer CP Pro ActiveX in ToolBox. Select Toolbox, select Components item, right click mouse button, select Choose Items...



Step 4: Select COM Components tab, select Image Viewer CP Pro ActiveX Control , click OK. 


Step 5: From the Toolbox, add the Image Viewer CP Pro ActiveX control to the design surface.


Step 6:  Add some buttons in form with the following code.  Let the user can open the image, set the view size and zoom the image.

        private void buttonLoad_Click(object sender, EventArgs e)

        {

            axImageViewer1.FileName ="c:\\yourfolder\\yourfile.jpg";

        }

 

        private void button25_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 1;

            this.axImageViewer1.Focus();

        }

 

        private void button33_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 2;

            this.axImageViewer1.Focus();

        }

 

        private void button50_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 3;

            this.axImageViewer1.Focus();

        }

 

        private void button75_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 4;

            this.axImageViewer1.Focus();

        }

 

        private void button100_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 5;

            this.axImageViewer1.Focus();

        }

        private void button150_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 6;

            this.axImageViewer1.Focus();

        }

 

        private void button200_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 7;

            this.axImageViewer1.Focus();

        }

 

        private void fitButton_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 9;

            this.axImageViewer1.Focus();

        }

        private void zoomWidthButton_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 10;

            this.axImageViewer1.Focus();

        }

 

        private void zoomHeightButton_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.View = 11;

            this.axImageViewer1.Focus();

        }

 

        private void zoomInButton_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.ZoomIn();

        }

 

        private void zoomOutButton_Click(object sender, EventArgs e)

        {

            this.axImageViewer1.ZoomOut();

        }


Step 7: Press F5 to build and run the application.