Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Mark E Mark  
#1 Posted : Tuesday, February 21, 2006 2:46:08 AM(UTC)
Mark E Mark

Rank: Member

Groups: Member
Joined: 2/21/2006(UTC)
Posts: 2

Hi Everyone,

I have just tried to get the my first App running with Graphic Mill.NET and I have hit a hurdle at the first step which is loading a picture into the BitmapViewer.


Background Info:
* .NET VERSION 1.1
* My project is a smart Client. I have a Stub windows App which then loads the main formapp from a URL which has a control libary with the GraphicMill Embedded in that application (I know its convoluted but it must have this arc).

Code that Causes Error:


Code:
			Aurigma.GraphicsMill.WinControls.BitmapViewer bitViewer = new BitmapViewer();

			// Load Picture throws an error.., The file is there as I browse to it with OpenFileDialog
			bitViewer.Bitmap.Load(pngFileName);


Exception:

Code:
"Object reference not set to an instance of an object at ImagingFramework.DataItem.FreePointerValue(DataItem* )\r\n   at Aurigma.GraphicsMill.Codecs.FormatReader.Dispose(Boolean disposing)\r\n   at Aurigma.GraphicsMill.SyncHandler.Dispose()\r\n   at Aurigma.GraphicsMill.Codecs.FormatReader.Dispose()\r\n   at Aurigma.GraphicsMill.Bitmap.Load(String fileName)\r\n   at TopUpTvControlLibrary.ttPNGImageConverterV2.ConvertPNG(String pngFileName, Int32 width, Int32 height, String& resultantFileNameAndPath)\r\n   at TopUpTvControlLibrary.ttInputPanel.mnuItemLoadPNG_Click(Object sender, EventArgs e)\r\n   at System.Windows.Forms.MenuItem.OnClick(EventArgs e)\r\n   at System.Windows.Forms.MenuItemData.Execute()\r\n   at System.Windows.Forms.Command.Invoke()\r\n   at System.Windows.Forms.Command.DispatchID(Int32 id)\r\n   at System.Windows.Forms.Control.WmCommand(Message& m)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n   at System.Windows.Forms.UserControl.WndProc(Message& m)\r\n   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n   at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n   at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.Run(Form mainForm)\r\n   at TopUPTVControlPanel.MainForm.Main()



Any help would be appreciated!!!!

Regards

Mark

Edited by user Thursday, December 20, 2007 5:06:20 PM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Tuesday, February 21, 2006 12:18:54 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 866

Thanks: 2 times
Was thanked: 25 time(s) in 25 post(s)
Hi Mark,

First of all, I see that you trying to create BitmapViewer control instance in run-time. In most cases it is not correct (unless you really need to add controls dynamically).
  1. If you need to display an image in the BitmapViewer control, you should drop in on form as said in the quick start topic of Graphics Mill manual.
  2. If you need not visual user interface at all (e.g. you just need to convert PNG image to JPEG, or apply some transform without displaying it to the user), should use the Aurigma.GraphicsMill.Bitmap class instead of BitmapViewer. In this case the code will be looking as follows:
    Code:
    Aurigma.GraphicsMill.Bitmap bmp = new Aurigma.GraphicsMill.Bitmap(pngFileName);
  3. If you need to display the image in the BitmapViewer, but for some reason you need to add them dynamically rather than in design-time, you should initialize the Bitmap property before accessing it.
    Code:
    Aurigma.GraphicsMill.WinControls.BitmapViewer bitViewer = new Aurigma.GraphicsMill.WinControls.BitmapViewer();
    
    // Load Picture throws an error.., The file is there as I browse to it with OpenFileDialog
    bitViewer.Bitmap = new Aurigma.GraphicsMill.Bitmap(pngFileName);
    
Hope this helps.

Edited by user Wednesday, October 29, 2008 1:54:02 PM(UTC)  | Reason: Not specified

Mark E Mark  
#3 Posted : Tuesday, February 21, 2006 7:03:18 PM(UTC)
Mark E Mark

Rank: Member

Groups: Member
Joined: 2/21/2006(UTC)
Posts: 2

Hi Andrew,

Thanks Immensely for your help. I knew it had to be something simple like.... Point 2. Yes I just need to apply the transforms to graphics files.

The Graphics Mill for .NET is the most powerful library I have seen so far, however its Object Model is laid out so simply that it makes it the BEST Library I have used.

Regards

Mark
Users browsing this topic
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.