"A generic error has occurred in GDI+"

"A generic error has occurred in GDI+"

Anonymous
Not applicable
3,256 Views
9 Replies
Message 1 of 10

"A generic error has occurred in GDI+"

Anonymous
Not applicable

What does this mean and how can i fix it?

0 Likes
3,257 Views
9 Replies
Replies (9)
Message 2 of 10

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

the issue itself is depending on operating system and graphic card. >>>search results<<<.

I don't think it's something specific to AutoCAD.

 

So let me ask some questions:

  • What product and service pack do you use
  • What operating system do you have
  • What graphic card and driver version do you have
  • When and how often do you get that message
  • Can you show the screenshot so we see what's on your screen when that message appeared.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 10

Anonymous
Not applicable

Hi.

I have a similar problem only with Autocad LT 2010 (upgraded with the last service pack)) on Windows 10 (last upgrade). The problem appears only when switch trough differents drawings with the comand "Disegni vista rapida" on the bottom right.

The error detail is:

L'applicazione non supporta il debug JIT.
Ulteriori informazioni sono riportate in fondo al messaggio.

************** Testo dell'eccezione **************
System.Runtime.InteropServices.ExternalException: Errore generico in GDI+.
in System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
in System.Drawing.Image.FromHbitmap(IntPtr hbitmap)
in Autodesk.AutoCAD.Runtime.Marshaler.BitmapInfoToBitmap(IntPtr bitmapInfo)
in Autodesk.AutoCAD.Internal.LayoutThumbnailEnumerator.get_Thumbnail()
in Autodesk.AutoCAD.Ribbon.QuickViewManagerUtility.UpdateQVDataForLayoutImages(List`1 qvLayoutList, LayoutThumbnailEnumerator eThumbnail)
in Autodesk.AutoCAD.Ribbon.DocumentsQuickViewDataManager.RefreshLayoutData()
in Autodesk.AutoCAD.Ribbon.DocumentsQuickViewManager.AcadApplication_Idle(Object sender, EventArgs e)
in System.EventHandler.Invoke(Object sender, EventArgs e)
in Autodesk.AutoCAD.ApplicationServices.Application.raise_Idle(Object value0, EventArgs value1)
in Autodesk.AutoCAD.ApplicationServices.Application.OnIdle()


************** Assembly caricati **************
mscorlib
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
acdbmgd
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcdbMgd.DLL
----------------------------------------
msvcm90
Versione assembly: 9.0.30729.9177
Versione Win32: 9.00.30729.9177
Base di codice: file:///C:/WINDOWS/WinSxS/amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9177_none_08e695a3a83b6ce3/msvcm90.dll
----------------------------------------
PresentationFramework
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
WindowsBase
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
System
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
PresentationCore
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_64/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
System.Drawing
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
PresentationCore.resources
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationCore.resources/3.0.0.0_it_31bf3856ad364e35/PresentationCore.resources.dll
----------------------------------------
mscorlib.resources
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
AdWindowsInterop
Versione assembly: 0.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AdWindowsInterop.DLL
----------------------------------------
AdWindows
Versione assembly: 2.1.0.0
Versione Win32: 2.1.123.309
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AdWindows.DLL
----------------------------------------
AdWindows.resources
Versione assembly: 2.1.0.0
Versione Win32: 18.0.55.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/it-IT/AdWindows.resources.DLL
----------------------------------------
acmgd
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/acmgd.DLL
----------------------------------------
System.Configuration
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
AcWindows
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcWindows.DLL
----------------------------------------
System.Core
Versione assembly: 3.5.0.0
Versione Win32: 3.5.30729.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
AcWindows.resources
Versione assembly: 18.0.0.0
Versione Win32: 18.0.55.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/it-IT/AcWindows.resources.DLL
----------------------------------------
AcCui
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcCui.DLL
----------------------------------------
AcTaskDialogs
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcTaskDialogs.DLL
----------------------------------------
AcTaskDialogs.resources
Versione assembly: 18.0.0.0
Versione Win32: 18.0.55.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/it-IT/AcTaskDialogs.resources.DLL
----------------------------------------
System.Windows.Forms
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
PresentationFramework.Aero
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework.Aero/3.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
----------------------------------------
PresentationFramework.resources
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework.resources/3.0.0.0_it_31bf3856ad364e35/PresentationFramework.resources.dll
----------------------------------------
ContextualTabSelectorRules
Versione assembly: 0.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcWindows.dll
----------------------------------------
ManagedMC3
Versione assembly: 2.20.0.0
Versione Win32: 3.14.1
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/ManagedMC3.DLL
----------------------------------------
UIAutomationProvider
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/UIAutomationProvider/3.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
----------------------------------------
AcLayer
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcLayer.DLL
----------------------------------------
AcLayer.resources
Versione assembly: 18.0.0.0
Versione Win32: 18.0.55.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/it-IT/AcLayer.resources.DLL
----------------------------------------
System.Web.Services
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
WindowsFormsIntegration
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/WindowsFormsIntegration/3.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------
7osyhg2u
Versione assembly: 2.1.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.XML.resources
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml.resources/2.0.0.0_it_b77a5c561934e089/System.Xml.resources.dll
----------------------------------------
System.Web.Services.resources
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services.resources/2.0.0.0_it_b03f5f7f11d50a3a/System.Web.Services.resources.dll
----------------------------------------
Accessibility
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
AcCommandToolTips
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcCommandToolTips.DLL
----------------------------------------
AcCommandTooltips.resources
Versione assembly: 18.0.0.0
Versione Win32: 18.0.55.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/it-IT/AcCommandToolTips.resources.DLL
----------------------------------------
AcDialogToolTips
Versione assembly: 18.0.0.0
Versione Win32: 18.0.309.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/AcDialogToolTips.DLL
----------------------------------------
AcDialogTooltips.resources
Versione assembly: 18.0.0.0
Versione Win32: 18.0.55.0.0
Base di codice: file:///C:/Program%20Files/AutoCAD%20LT%202010/it-IT/AcDialogToolTips.resources.DLL
----------------------------------------
System.Drawing.resources
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing.resources/2.0.0.0_it_b03f5f7f11d50a3a/System.Drawing.resources.dll
----------------------------------------
System.Windows.Forms.resources
Versione assembly: 2.0.0.0
Versione Win32: 2.0.50727.8670 (QFE.050727-8600)
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_it_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
PresentationFramework.Luna
Versione assembly: 3.0.0.0
Versione Win32: 3.0.6920.8693 built by: QFE
Base di codice: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework.Luna/3.0.0.0__31bf3856ad364e35/PresentationFramework.Luna.dll
----------------------------------------

************** Debug JIT **************
L'applicazione non supporta il debug JIT
di Windows Form. Per ulteriori informazioni, contattare l'autore
dell'applicazione.

 

Thanks

0 Likes
Message 4 of 10

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Autocad LT 2010 (upgraded with the last service pack)) on Windows 10

AutoCAD LT 2010 is not supported to run on Windows 10, either update your AutoCAD LT or make the step back to your original operating system.

 

Details from Autodesk about their products on Windows 10 >>>click<<<

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 10

Anonymous
Not applicable

Strange, because I am using windows 10 with autocad LT2010 from this summer and today is the first time that appear this problem...

0 Likes
Message 6 of 10

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> I am using windows 10 with autocad LT2010 from this summer

Then you are one of the lucky ones, at least for a few months.

So when it was running well and now stopped then look what happend to your system, most probably some updates where installed (or any other software)?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 10

kelidesign
Enthusiast
Enthusiast
    public static Bitmap GetBlockImage(this ObjectId objectId, Size size)
    {
      if (!objectId.IsValid())
        throw new InvalidDataException(nameof (objectId));
      if (size.IsEmpty)
        throw new InvalidDataException(nameof (size));
      Autodesk.AutoCAD.Colors.Color backgroundColor = Autodesk.AutoCAD.Colors.Color.FromRgb((byte) 0, (byte) 0, (byte) 0);
      return System.Drawing.Image.FromHbitmap(Utils.GetBlockImage(objectId, size.Width, size.Height, backgroundColor));
    }

I also encountered this type of error, what should I do? I am currently using the English version of autocad 2018. I remembered before that it seemed that it was not difficult to get the preview of the block reference, but now I don't know what I forgot, and it keeps throwing this error message.

 

0 Likes
Message 8 of 10

kelidesign
Enthusiast
Enthusiast

Can you take a look at it for me? Thank you very much. In order to more clearly restore the current dilemma, I will show more code.

 

        var doc = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument;
        var db = doc.Database;
        var locadCADPath = "test.dwg";
        var locadDB = new Database(false, false);
        try
        {
            var tempName = string.Empty;
            locadDB.ReadDwgFile(locadCADPath, FileOpenMode.OpenTryForReadShare, true, null);
            locadDB.CloseInput(true);
            using (var trans = locadDB.TransactionManager.StartTransaction())
            {
                var bt = trans.GetObject(locadDB.BlockTableId, OpenMode.ForRead) as BlockTable;
                var ids = new ObjectIdCollection();
                foreach (var btrId in bt)
                {
                    var btr = trans.GetObject(btrId, OpenMode.ForRead) as BlockTableRecord;

                    if (!btr.IsLayout && !btr.IsAnonymous)
                    {
                        tempName = btr.Name;
                        var targetID = btr.ObjectId;
                        var image1 = targetID.GetBlockImage(new Size(60, 60));
                        image1.Save("image1.jpg");
                        var image2 = targetID.GetBlockImage(new Size(200, 200));
                        image2.Save("image2.jpg");
                        var image3 = targetID.GetBlockImage(new Size(500, 500));
                        image3.Save("image3.jpg");
                        ids.Add(targetID);
                        break;
                    }
                }
                locadDB.WblockCloneObjects(ids, db.BlockTableId, new IdMapping(), DuplicateRecordCloning.Ignore, false);
                trans.Commit();
            }
            locadDB.Dispose();
0 Likes
Message 9 of 10

kelidesign
Enthusiast
Enthusiast

System.Runtime.InteropServices.ExternalException: 'A generic error occurred in GDI+.'

 

This exception was originally thrown at this call stack:
System.Drawing.Image.FromHbitmap(System.IntPtr, System.IntPtr)
System.Drawing.Image.FromHbitmap(System.IntPtr)
DrawingMaster.XrefBlock.InternalNamespaceTool.GetBlockImage(Autodesk.AutoCAD.DatabaseServices.ObjectId, int, int, Autodesk.AutoCAD.Colors.Color) in BlockCommand.cs
DrawingMaster.XrefBlock.BlockCommand.Run() in BlockCommand.cs

0 Likes
Message 10 of 10

kelidesign
Enthusiast
Enthusiast

The reason I encountered: it is necessary to determine the blank blocks and filter them out, otherwise an error will occur.

 

https://forums.autodesk.com/t5/net/a-generic-error-has-occurred-in-gdi/m-p/12727098#M81789

0 Likes