Bug Report T821415
Visible to All Users

System.ArgumentException is thrown in the SkinImageColorizer.CalcLightness method

created 5 years ago

Hello,
after upgrade to  19.1.6. version we encouter the exception "parameter is not valid" when bandedgrid is being painted.
It happens occasionally I cant reproduce.
But never happens with 18.2.
Exception is thrown at SkinImageColorizer.CalcLightness methods, as I can compare c# source code of 18.2 and 19.1 - >  the CalcLightness method is new one.

Parametr není platný. ("parameter is not valid")

Exception Type:
  System.ArgumentException
Source:  System.Drawing
StackTrace:
     v System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
   v DevExpress.Skins.SkinImageColorizer.CalcLightness(Image sourceImage)
   v DevExpress.Skins.SkinImageColorizer.GetSmartColorizedImage(Image image, Color color)
   v DevExpress.Skins.SkinImage.GetColoredImages(Image image)
   v DevExpress.Skins.SkinImage.GetColoredImage(Image image)
   v DevExpress.Utils.Text.ContrastColor.CalcDefaultForeColor(Color foreColor)
   v DevExpress.Utils.Drawing.HeaderObjectPainter.DrawObject(ObjectInfoArgs e)
   v DevExpress.Utils.Drawing.UltraFlatHeaderObjectPainter.DrawObject(ObjectInfoArgs e)
   v DevExpress.XtraGrid.Views.BandedGrid.Drawing.BandedGridPainter.<>c__DisplayClass10_0.<DrawBandCore>b__0()
   v DevExpress.XtraGrid.Views.Base.CustomDrawEventArgs.DefaultDraw()
   v DevExpress.XtraGrid.Views.BandedGrid.Drawing.BandedGridPainter.DrawBandCore(BandedGridViewDrawArgs e, GridBandInfoArgs bi)
   v DevExpress.XtraGrid.Views.BandedGrid.Drawing.BandedGridPainter.DrawBand(BandedGridViewDrawArgs e, GridBandInfoArgs bi)
   v DevExpress.XtraGrid.Views.BandedGrid.Drawing.BandedGridPainter.DrawBandPanel(BandedGridViewDrawArgs e)
   v DevExpress.XtraGrid.Views.BandedGrid.Drawing.BandedGridPainter.DrawColumnPanel(GridViewDrawArgs e)
   v DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawContentsCore(GridViewDrawArgs e)
   v DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawCore(GridViewDrawArgs e)
   v DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.Draw(ViewDrawArgs ee)
   v DevExpress.XtraGrid.Views.Base.BaseView.Draw(GraphicsCache e)
   v DevExpress.XtraGrid.Views.Grid.GridView.Draw(GraphicsCache e)
   v DevExpress.XtraGrid.GridControl.OnPaintCore(PaintEventArgs e)
   v DevExpress.Utils.Drawing.ControlPaintHelper.PaintWithErrorHandling(PaintEventArgs paintEventArgs, Int32 layer)
   v DevExpress.Utils.Drawing.ControlPaintHelper.ProcessWMPaintCore(Boolean beginPaint, IntPtr hdc, Rectangle rectangle, Rectangle[] clipBounds)
   v DevExpress.Utils.Drawing.ControlPaintHelper.ProcessWMPaint(Message& m)
   v DevExpress.XtraGrid.GridControl.CheckProcessMsg(Message& m)
   v DevExpress.XtraGrid.GridControl.WndProc(Message& m)
   v System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
TargetSite:
  Void .ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)

Comments (3)
DevExpress Support Team 5 years ago

    Hi Stanislav,

    I couldn't reproduce this behavior. Nevertheless, we have found a possible reason why this exception is thrown and are planning to fix the issue. Please test the hotfix when it is ready.
    I look forward to your results.

    SS SS
    Stanislav Snajberg 5 years ago

      We will test, can I ask download hotfix?

      DevExpress Support Team 5 years ago

        I've requested this hotfix for you. We usually deliver a hotfix within a week after it is requested.

        Answers approved by DevExpress Support

        created 5 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)

            I ran into a similar problem. When will the hotfix be available?

            DevExpress Support Team 5 years ago

              We plan to release version 19.1.7, which includes a fix for this issue, these days. We will notify you via email when it is ready.
              Please feel free to reactivate this ticket in case of other questions regarding this scenario.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.