Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, June 18, 2008 11:57:07 PM(UTC)
dalton565

Groups: Registered
Posts: 5


Hey guys

wondering if you can help. We are using Leadtools v15
The sample application we have been using is 64bit Draw located under raster imaginging pro > more demos

Basically we have a very large bitmap file (32,000px by 32,000px) filesize = 1GB
Its loads ok into the program but once when try to do anything to it, eg draw a square,line,cirle

We get the attached exception, Is there a known fix for this issue. We are using a high spec 64bit machine with 16GB of RAM.

full error message details below:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: Image is not GDI+ compatible
   at Leadtools.RasterImage.ChangeToGdiPlusImage(ChangeToGdiPlusImageFlags flags)
   at Leadtools.RasterImage.CreateGdiPlusGraphics()
   at DrawDemo.MainForm._viewer_MouseUp(Object sender, MouseEventArgs e)
   at Leadtools.WinForms.RasterImageViewer.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Leadtools.WinForms.RasterImageViewer.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
VBDrawDemo
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/VBDrawDemo_Original.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
Leadtools.Codecs
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,8
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.Codecs.DLL
----------------------------------------
Leadtools.WinForms
    Assembly Version: 15.0.0.0
    Win32 Version: 15.0.1.1
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.WinForms.DLL
----------------------------------------
Leadtools
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,3
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.DLL
----------------------------------------
msvcm80
    Assembly Version: 8.0.50727.1433
    Win32 Version: 8.00.50727.1433
    CodeBase: file:///C:/WINDOWS/WinSxS/amd64_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_8F022AB2/msvcm80.dll
----------------------------------------
Leadtools.WinForms.CommonDialogs.File
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,1
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.WinForms.CommonDialogs.File.DLL
----------------------------------------
Leadtools.Codecs.Fax
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,0
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.Codecs.Fax.DLL
----------------------------------------
Leadtools.Codecs.Cmp
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,0
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.Codecs.Cmp.DLL
----------------------------------------
Leadtools.Codecs.Tif
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,0
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.Codecs.Tif.DLL
----------------------------------------
Leadtools.Codecs.Jbg
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,0
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.Codecs.Jbg.DLL
----------------------------------------
Leadtools.Codecs.Bmp
    Assembly Version: 15.0.0.0
    Win32 Version: 15,0,1,0
    CodeBase: file:///C:/Program%20Files%20(x86)/LEAD%20Technologies/LEADTOOLS%20Dotnet%20EVAL%2015/Bin/Dotnet/x64/Leadtools.Codecs.Bmp.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.




 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, June 19, 2008 12:04:33 AM(UTC)
dalton565

Groups: Registered
Posts: 5


error message attached
dalton565 attached the following image(s):
errorBitmap.JPG
 
#3 Posted : Thursday, June 19, 2008 6:49:26 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 1 time(s) in 1 post(s)

Microsoft GDI+ supports some types of images, such as 1-bit, 4-bit, 8-bit and 24-bit.
LEADTOOLS supports other image types that GDI+ does not support directly, such as 3-bit and 7-bit color, and 12-bit grayscale.

If the image is of a supported type (such as 24 or 8 bit) but fails to be converted to GDI+ image, the reason might be the failure of Windows itself to allocate such a huge block of contiguous memory.
If that is the case, you can try to work around the limitation as follows:
1. Create a second LEADTOOLS RasterImage object and fill it with an appropriate background color that is different from the objects you want to draw (examples are black or white)
2. Draw the needed objects on this small image.
3. Transfer the drawings to the large image using the CombineFastCommand class.
 
#4 Posted : Friday, June 20, 2008 2:04:46 AM(UTC)
dalton565

Groups: Registered
Posts: 5


Hey. Thanks for the Reply was much appreciated.

Your suggestion is good unfortunatly it does not solve out problem. The way you suggested is pretty much the way we are handling the problem at the minute through another application. We currently split the large image up into 3 or 4 parts then edit them all individually. Unfortunatly for our designers this is very annoying and makes their jobs harder.

We are looking to develop an application that will display the complete large image (32,000 by 32,000px bitmap) all on the screen and allow the user to manipulate the image.

Is there anyway we can modify the code so that it will allow this.

We are still in the early stages, so dont want to start developing a complete application yet. So in Sticking with the csdraw 64bit application, is there anything else we could do to load the image, to allow editing on the complete image.

thanks
 
#5 Posted : Monday, June 23, 2008 5:03:31 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 1 time(s) in 1 post(s)

To know if this is possible or not, try to add this code to a brand new project that doesn't use LEADTOOLS:
System.Drawing.Bitmap b = new Bitmap(32000, 32000, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

If this fails, it shows there's a Windows limitation on such huge bitmaps, and it will not be possible to use GDI+ functions to draw on the image with or without our toolkit.

To try to find a workaround, can you please explain what types of objects you want to draw on the image? For example, are these objects similar to the LEADTOOLS annotations objects? (See the Ann Automation demos for examples.)

 
#6 Posted : Tuesday, June 24, 2008 1:56:14 AM(UTC)
dalton565

Groups: Registered
Posts: 5


Hey Yasir

Thanks for the reply. i tried your code above and it did not work. However for our purposes we do not require 24bit color, we can suffice with 8bit color, so when i tried

System.Drawing.Bitmap b = new Bitmap(32000, 32000, System.Drawing.Imaging.PixelFormat.Format8bppIndexed);
and
 System.Drawing.Bitmap b = new Bitmap(45000, 45000, System.Drawing.Imaging.PixelFormat.Format8bppIndexed);


and they did infact both work fine we found it failed at around 50x50k px but we dont need anything near this size. All the bitmaps we have tested all have 8bit color depth. We have been looking at the 64bit Draw applications as the other Annotations you suggested only allows annotations, and we need to be able to edit the image directly.

Some of the functionality we require are;
1. Open/Create a a new image 32k x 32k
2. Zoom in/Zoom out on the image
3. Draw squares/Rectangles/circles/lines/freehand
4. Change the pixel size 7x10ppi
5. Flood the image with colour
6. change individual pixel color
(Alot of the functionality provided by your 64bit DRAW package that sits here "LEAD Technologies\LEADTOOLS Dotnet EVAL 15\Bin\Dotnet\x64\CSDrawDemo_Original.exe")

Basically the general features you would find in any good drawing package like photoshop, with the added functionality we require, eg support for large images.

If these we requirements are satisfyable we would be very keen to go with your product.


 
#7 Posted : Thursday, June 26, 2008 7:05:30 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 1 time(s) in 1 post(s)

I found the cause of the problem. When the GDIGraphicsContainer is created, the image will be converted to 24 bits per pixel, which requires 3 times the memory needed by the 8-bit image. That's why you get the error.
Also, calling MakeGdiPlusCompatible(DontCare) converts to 24-bits.

As a workaround, you could use the RasterImage.CreateLeadDC Method, which does not convert to 24-bits. Here's a small code sample that I tried on an 8-bit image and it worked:
IntPtr hdc = myImage.CreateLeadDC();
Graphics gr = Graphics.FromHdc(hdc);
gr.DrawLine(new Pen(Color.Chocolate), 2, 3, 49, 89);
RasterImage.DeleteLeadDC(hdc);

This means either create your own sample project, or make the needed changes to our C# demo. Before you do that, I suggest testing a large image using the simple code above.
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.480 seconds.