XPToolbar Crasing and Red Cross coming.
Hi,
I have been using XPToolbar since some time but in the recent update i am getting issue with the component. Component gets crashed / a red cross appears within it.
i have tried my best to solve this, ensured that no cross thread communication should happen but still it is getting crashed randomly and some rarely too.
Is there anyway to handle these uncaught errors in the components? I am already using ThreadException and CurrentDomain.UnhandledException.
Stack Trace
07-Sep-2021 11:49:08.672 - Sender: System.Threading.Thread Class: System.Threading.Thread - Error: A generic error occurred in GDI+.
Stack: at System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
at System.Drawing.Image.FromHbitmap(IntPtr hbitmap)
at System.Windows.Forms.ImageList.GetBitmap(Int32 index)
at System.Windows.Forms.ImageList.ImageCollection.get_Item(Int32 index)
at System.Windows.Forms.ImageList.ImageCollection.System.Collections.IList.get_Item(Int32 index)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarItemRenderer.DrawTextAndImage(Graphics g, RectangleF rectTextAndImage, Font textFont, Color textColor, Color bgColor, DrawItemState state)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarItemRenderer.DrawInterior(DrawToolbarItemEventArgs drawItemInfo)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarItemRenderer.OnPaint(Graphics g, Rectangle clippingRect)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarRenderer.OnPaint(Graphics g, Rectangle clipRect)
at Syncfusion.Windows.Forms.Tools.XPMenus.MultilineBarRenderer.OnPaint(Graphics g, Rectangle clipRect)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnPaint(PaintEventArgs e)
at Syncfusion.Windows.Forms.Tools.XPMenus.XPToolBar.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.WndProc(Message& m)
at Syncfusion.Windows.Forms.Tools.XPMenus.XPToolBar.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(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)
Source: System.Drawing
####################################
Target Site: FromHbitmap
We have analyzed your reported query “Component gets crashed and red cross appears in XPToolBar”. However, we were unable to replicate the reported issue in our end. We noticed you described the sample crashing at randomly.
- When you are initializing a Bitmap object from an image stored on hard disk, it creates a lock on the underlying image file. Due to the lock when you try to save and overwrite your modified bitmap, it throws this error.
- When you are saving a file, make sure the user has Write permission on the folder. This is important when you are getting this error on the Website because Website runs under restricted permissions
Thirupathi B.
- 1 Reply
- 2 Participants
-
RS Rakesh Sharma
- Sep 7, 2021 08:49 AM UTC
- Sep 8, 2021 11:31 AM UTC