This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
BillPlunkett  
#1 Posted : Thursday, April 14, 2005 1:56:00 PM(UTC)
BillPlunkett

Rank: Member

Groups: Guest
Joined: 4/14/2005(UTC)
Posts: 4

I am using the trial download with the hope that GraphicsMill will give me the 16-bit support I need for my C# application. I tried loading a 8-bit grayscale image, converting it to 16-bit grayscale and saving it. Saving as PNG seems to work okay (reload of saved file and File->ImageInfo shows 16-bits), but saving as TIFF causes the following exception:

Code:
Error arrised during saving following file:
C:\Documents and Settings\WAP\My Documents\My Pictures\foo2.bmp
System.InvalidCastException: Specified cast is not valid.
   at System.Convert.ToBoolean(Object value)
   at Main.TiffPropertyPage.set_Bitmap(Bitmap value) in C:\Program Files\Aurigma\Graphics Mill 3.0 for .NET\Windows Demo Source\MainCS\Controls\Codecs\TiffPropertyPage.cs:line 377
   at Main.EncoderOptionsDialog.ShowEncoderDialog(Bitmap bitmap, UserControl propertyPage, IEncoderOptions encoderOptions) in C:\Program Files\Aurigma\Graphics Mill 3.0 for .NET\Windows Demo Source\MainCS\EncoderOptionsDialog.cs:line 155
   at Main.FormMain.bitmap_Saving(Object sender, BitmapSavingEventArgs e) in c:\program files\aurigma\graphics mill 3.0 for .net\windows demo source\maincs\formmain.cs:line 1757
   at Aurigma.GraphicsMill.Bitmap.raise_Saving(Object i1, BitmapSavingEventArgs i2)
   at Aurigma.GraphicsMill.Bitmap._RaiseSavingEvent(IEncoderOptions options)
   at Aurigma.GraphicsMill.Codecs.Frame._RaiseBitmapSavingEvent(IEncoderOptions options)
   at Aurigma.GraphicsMill.Codecs.FormatWriter.RaiseSavingEvent(Frame frame)
   at Aurigma.GraphicsMill.Codecs.TiffWriter._AddFrame(Frame frame)
   at Aurigma.GraphicsMill.Codecs.FormatWriter.AddFrame(IFrame frame)
   at Aurigma.GraphicsMill.Bitmap.Save(String fileName)
   at Main.FormMain.MenuItemSave_Click(Object sender, EventArgs e) in c:\program files\aurigma\graphics mill 3.0 for .net\windows demo source\maincs\formmain.cs:line 2270



Is there a workaround for this problem?

Thanks,
Bill

Edited by user Monday, December 24, 2007 3:54:15 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Thursday, April 14, 2005 7:01:00 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Guest
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

C# version of Main sample was generated automatically from VB version of the sample. Some pieces of code was converted incorrectly. The fixed sample will be available in the next release. If you want to correct it by yourself you should replace the piece of code from line 362 to line 379 by the following code snippet:
Code:
private Aurigma.GraphicsMill.Bitmap _bitmap;
private TiffEncoderOptions _encoderOptions;

public Aurigma.GraphicsMill.Bitmap Bitmap
{
	get{
		return _bitmap;
	}
	set
	{
		_bitmap = value;
		bool ccittEnabled = (_bitmap.PixelFormat == PixelFormat.Format1bppIndexed);
		RadioButtonCCITTGroup3.Enabled = ccittEnabled;
		RadioButtonCCITTGroup4.Enabled = ccittEnabled;
		RadioButtonCCITTRLE.Enabled = ccittEnabled;
		RadioButtonJPEG.Enabled = (_bitmap.IsIndexed == false && _bitmap.IsExtended == false);
	}
}

If you have similar problems with C# sample please refer to VB sample.

Thanks for your response.

Edited by user Monday, December 24, 2007 3:54:30 PM(UTC)  | Reason: Not specified

Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
BillPlunkett  
#3 Posted : Thursday, April 14, 2005 11:26:00 PM(UTC)
BillPlunkett

Rank: Member

Groups: Guest
Joined: 4/14/2005(UTC)
Posts: 4

Thanks a lot. That worked.

By the way, for others who may want to make this change, the file is Controls\Codecs\TiffPropertyPage.cs.

Bill
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.