public UnlockIXandProcessImg() { try { imagXpress1 = new Accusoft.ImagXpressSdk.ImagXpress(); //***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�"); //System.Console.WriteLine("ImagXpress successfully licensed."); imagProcessor = new Accusoft.ImagXpressSdk.Processor(imagXpress1); soSaveOptions = new Accusoft.ImagXpressSdk.SaveOptions(); soSaveOptions.Format = ImageXFormat.Tiff; soSaveOptions.Tiff.Compression = Compression.Group4; sInputFileName = System.IO.Path.Combine(strCurrentDir, @"..\..\..\..\..\..\..\..\..\..\Common\Images\Benefits.tif"); sOutputFileName = (strCurrentDir + "\\BenefitsRotated.tif"); imagX1 = Accusoft.ImagXpressSdk.ImageX.FromFile(imagXpress1, sInputFileName); imagProcessor.Image = imagX1; imagProcessor.Rotate(180); imagX1 = imagProcessor.Image; imagX1.Save(sOutputFileName, soSaveOptions); Dispose(); System.Console.WriteLine(("Rotated TIFF saved to file " + sOutputFileName)); System.Console.ReadLine(); } catch (Accusoft.ImagXpressSdk.ImagXpressException ex) { Dispose(); System.Console.WriteLine(ex.Message); System.Console.WriteLine(ex.Source); System.Console.ReadLine(); } catch (System.Exception ex) { Dispose(); System.Console.WriteLine(ex.Message); System.Console.WriteLine(ex.Source); System.Console.ReadLine(); } }
private void cmdRotate_Click(object sender, System.EventArgs e) { // Perform image processing to demonstrate that two ImagXpress controls // are viewing the same image buffer try { Accusoft.ImagXpressSdk.Processor process; process = new Accusoft.ImagXpressSdk.Processor(imagXpress1, imageXViewMain.Image); process.Rotate(90); // clear out the error in case there was an error from a previous operation lblError.Text = ""; } catch (Accusoft.ImagXpressSdk.ImagXpressException ex) { AccusoftError(ex, lblError); } catch (System.NullReferenceException ex) { AccusoftError(ex, lblError); } this.Refresh(); }