Example #1
0
        private void formMain_Load(object sender, System.EventArgs e)
        {
            comboRenderIntent.SelectedIndex = 0;

            //***The SetSolutionName, SetSolutionKey and possibly the SetOEMLicenseKey methods must be called to distribute the runtime***
            //imagXpress1.Licensing.SetSolutionName("YourSolutionName");
            //imagXpress1.Licensing.SetSolutionKey(12345,12345,12345,12345);
            //imagXpress1.Licensing.SetOEMLicenseKey("1.0.AStringForOEMLicensingContactAccusoftSalesForMoreInformation�");

            // 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.
            imageXView1.AutoImageDispose = true;

            loLoadOptions = new Accusoft.ImagXpressSdk.LoadOptions();

            ICMMonitorProfile = imageXView1.MonitorProfileName;
            ICMPrinterProfile = imageXView1.PrinterProfileName;
            ICMTargetProfile  = imageXView1.TargetProfileName;
            ICMRenderIntent   = imageXView1.ColorRenderIntent;
            //here we set the current directory and image so that the file open dialog box works well
            strCurrentDir = System.IO.Path.Combine(Application.StartupPath, @"..\..\..\..\..\..\..\..\..\..\Common\Images\");
            if (System.IO.Directory.Exists(strCurrentDir))
            {
                System.IO.Directory.SetCurrentDirectory(strCurrentDir);
            }
            strCurrentDir = System.IO.Directory.GetCurrentDirectory();

            strCurrentImage = System.IO.Path.Combine(strCurrentDir, "window.jpg");

            imageXView1.IcmEnabled         = true;
            imageXView1.IcmProofingEnabled = true;

            if (System.IO.File.Exists(strCurrentImage))
            {
                try
                {
                    imageXView1.Image = Accusoft.ImagXpressSdk.ImageX.FromFile(imagXpress1, strCurrentImage, loLoadOptions);
                }
                catch (Accusoft.ImagXpressSdk.ImagXpressException eX)
                {
                    AccusoftError(eX, labelError);
                }
            }
        }
Example #2
0
        static private Accusoft.ImagXpressSdk.ImageX StreamInFile(System.String sFilename, Accusoft.ImagXpressSdk.LoadOptions oOpts, ImagXpress imagXpress1)
        {
            System.Int32 iFileLength;

            System.IO.FileStream fsReader = new System.IO.FileStream(sFilename, System.IO.FileMode.Open);
            iFileLength = Convert.ToInt32(fsReader.Length);
            if (iFileLength < 0)
            {
                iFileLength = 0;
                fsReader.Close();
                return(null);
            }
            else
            {
                Accusoft.ImagXpressSdk.ImageX returnImageX = Accusoft.ImagXpressSdk.ImageX.FromStream(imagXpress1, fsReader, oOpts);
                fsReader.Close();
                return(returnImageX);
            }
        }
Example #3
0
        private void FormMain_Load(object sender, System.EventArgs e)
        {
            //***The SetSolutionName, SetSolutionKey and possibly the SetOEMLicenseKey methods must be called to distribute the runtime***
            //imagXpress1.Licensing.SetSolutionName("YourSolutionName");
            //imagXpress1.Licensing.SetSolutionKey(12345,12345,12345,12345);
            //imagXpress1.Licensing.SetOEMLicenseKey("1.0.AStringForOEMLicensingContactAccusoftSalesForMoreInformation�");

            try
            {
                // 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.
                imageXView1.AutoImageDispose    = true;
                imageXView2.AutoImageDispose    = true;
                imageXView3.AutoImageDispose    = true;
                imageXView4.AutoImageDispose    = true;
                imageXViewMain.AutoImageDispose = true;

                opts = new Accusoft.ImagXpressSdk.LoadOptions();

                String strCurrentDir = System.IO.Path.Combine(Application.StartupPath, @"..\..\..\..\..\..\..\..\..\..\Common\Images\");
                if (System.IO.Directory.Exists(strCurrentDir))
                {
                    System.IO.Directory.SetCurrentDirectory(strCurrentDir);
                }
                strCurrentDir = System.IO.Directory.GetCurrentDirectory();

                strImagePaths = new System.String[4];

                strImagePath = System.IO.Path.Combine(strCurrentDir, "window.jpg");
                cboImageList.Items.Add(parseFNam(strImagePath));
                imageXView1.Image      = Accusoft.ImagXpressSdk.ImageX.FromFile(imagXpress1, strImagePath, opts);
                imageXView1.AutoResize = Accusoft.ImagXpressSdk.AutoResizeType.BestFit;
                strImagePaths[0]       = strImagePath;

                strImagePath = System.IO.Path.Combine(strCurrentDir, "door.jpg");
                cboImageList.Items.Add(parseFNam(strImagePath));
                imageXView2.Image      = Accusoft.ImagXpressSdk.ImageX.FromFile(imagXpress1, strImagePath, opts);
                imageXView2.AutoResize = Accusoft.ImagXpressSdk.AutoResizeType.BestFit;
                strImagePaths[1]       = strImagePath;

                strImagePath = System.IO.Path.Combine(strCurrentDir, "water.jpg");
                cboImageList.Items.Add(parseFNam(strImagePath));
                imageXView3.Image      = Accusoft.ImagXpressSdk.ImageX.FromFile(imagXpress1, strImagePath, opts);
                imageXView3.AutoResize = Accusoft.ImagXpressSdk.AutoResizeType.BestFit;
                strImagePaths[2]       = strImagePath;

                strImagePath = System.IO.Path.Combine(strCurrentDir, "boat.jpg");
                cboImageList.Items.Add(parseFNam(strImagePath));
                imageXView4.Image      = Accusoft.ImagXpressSdk.ImageX.FromFile(imagXpress1, strImagePath, opts);
                imageXView4.AutoResize = Accusoft.ImagXpressSdk.AutoResizeType.BestFit;
                strImagePaths[3]       = strImagePath;

                imageXViewMain.Image      = imageXView1.Image;
                imageXViewMain.AutoResize = AutoResizeType.BestFit;

                cboImageList.SelectedIndex = 0;
            }
            catch (Accusoft.ImagXpressSdk.ImagXpressException ex)
            {
                AccusoftError(ex, lblError);
            }
        }