Beispiel #1
0
        public ProcessorThread(System.String daImageFileName,
                               Accusoft.ImagXpressSdk.ImageXView daViewer,
                               System.Windows.Forms.Label daLabel,
                               System.Int32 daSize, ImagXpress daImagXpress)
        {
            //set our references to these objects
            this.myReferenceToMyViewer = daViewer;
            this.myReferenceToMyLabel  = daLabel;
            this.daImagXpress          = daImagXpress;
            //since we do not need to pass back the filename, we can clone it to eliminate cross thread fears
            this.myImageFileName = (string)daImageFileName.Clone();

            //types such as System.Int32 are not real objects, so no cross thread fears.
            this.myResize = daSize;
        }
Beispiel #2
0
        private void menuItem2_Click(object sender, System.EventArgs e)
        {
            string filename = AccusoftOpenFile();

            if (filename.Length != 0)
            {
                cboImageList.Items[cboImageList.SelectedIndex] = parseFNam(filename);
                strImagePaths[cboImageList.SelectedIndex]      = filename;

                try
                {
                    Accusoft.ImagXpressSdk.ImageXView tmp = new Accusoft.ImagXpressSdk.ImageXView(imagXpress1);
                    switch (cboImageList.SelectedIndex)
                    {
                    case 0:
                        tmp = this.imageXView1;
                        break;

                    case 1:
                        tmp = this.imageXView2;
                        break;

                    case 2:
                        tmp = this.imageXView3;
                        break;

                    case 3:
                        tmp = this.imageXView4;
                        break;

                    default:
                        break;
                    }
                    tmp.Image            = StreamInFile(filename, opts, imagXpress1);
                    imageXViewMain.Image = tmp.Image;

                    // clear out the error in case there was an error from a previous operation
                    lblError.Text = "";
                }
                catch (Accusoft.ImagXpressSdk.ImagXpressException ex)
                {
                    AccusoftError(ex, lblError);
                }
                this.Refresh();
            }
        }
Beispiel #3
0
        public MainForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            viewerLabel = new System.Windows.Forms.Label[6];
            try
            {
                ixViewer = new Accusoft.ImagXpressSdk.ImageXView[6];
            }
            catch (ImagXpressException eX)
            {
                AccusoftError(eX, lblError);
            }
            int x = 17, y = 190;
            int i;

            for (i = 0; i < 6; i++)
            {
                try
                {
                    viewerLabel[i]           = new System.Windows.Forms.Label();
                    viewerLabel[i].Parent    = this;
                    viewerLabel[i].Left      = x;
                    viewerLabel[i].Top       = y;
                    viewerLabel[i].Width     = LABEL_WIDTH;
                    viewerLabel[i].Height    = LABEL_HEIGHT;
                    viewerLabel[i].TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                    viewerLabel[i].Text      = i.ToString();

                    ixViewer[i]        = new Accusoft.ImagXpressSdk.ImageXView(this.Container, imagXpress1);
                    ixViewer[i].Parent = this;
                    ixViewer[i].Left   = x;
                    ixViewer[i].Top    = y + LABEL_HEIGHT;
                    ixViewer[i].Width  = VIEWER_WIDTH;
                    ixViewer[i].Height = VIEWER_HEIGHT;

                    // Because in this sample the ImageX object is always located in the ImageXView
                    // tell the ImageXView component to dispose of the ImageX object when itself is
                    // disposed. Otherwise, we would have to dispose of the ImageX object in the Form's
                    // Dispose method before the components.Dispose() section.
                    ixViewer[i].AutoImageDispose = true;
                }
                catch (ImagXpressException eX)
                {
                    AccusoftError(eX, lblError);
                }

                x += VIEWER_WIDTH + VIEWER_SPACING;
                if (x > ((VIEWER_WIDTH + VIEWER_SPACING) * 3) + VIEWER_SPACING)
                {
                    y += VIEWER_HEIGHT + LABEL_HEIGHT + VIEWER_SPACING;
                    x  = 17;
                }
            }
        }