Bug Report T686048
Visible to All Users

cxCheckBox - An image assigned to the Properties.Glyph property is displayed incorrectly if it contains semitransparent pixels

created 6 years ago

Dear Sirs,

Png or svg images with transparency do not show their edges well. In other controls like TcxImage or TcxButton the same image is displayed correctly.

I attach a simplified project file in which you can clearly see the problem and the images with which it is tested.

Thanks in advance

Show previous comments (1)
EC EC
EDUARDO CALABUIG 6 years ago

    It's important for us, we have TcxCheckbox with images inside TcxVerticalGrid in column fields, is there any quick alternative? The svg icons with transparency in these cases we look very bad

    DevExpress Support Team 6 years ago

      Hello CESAR,

      The most appropriate workaround I see it to manually draw required icons by using the OnDrawValue event and the ACanvas.DrawImage method. Of course, in this case this row should not have in-place editors (it should not be editable) and cell values should be changed manually by handling clicks.

      EC EC
      EDUARDO CALABUIG 6 years ago

        Hello Paulo,

        We have implemented the proposed workaround, it seems to work but with High DPI ACanvas.DrawImage does not scale the images correctly and they look smaller than they should.

        I attach some code to see what we do and if you can, propose an alternative.

        cxTreeList1CustomDrawDataCell(TcxCustomTreeList *, TcxCanvas *ACanvas, TcxTreeListEditCellViewInfo *AViewInfo, bool &ADone)
        {
        int left, top, imageIndex;

        TcxImageList *imageList;
        TColor borderSeparator;

        if ( AViewInfo->Column == cxTreeListUnitsColumnVisible ) {
        imageList = GetImageListCheckBoxes( );

        imageIndex = unit->IsVisible( ) ? 0 : 1;

        left = AViewInfo->BoundsRect.Left + ( AViewInfo->BoundsRect.Width() - imageList->Width ) / 2.0;
        top = AViewInfo->BoundsRect.Top + ( AViewInfo->BoundsRect.Height() - imageList->Height ) / 2.0;

        borderSeparator = ( TColor ) RGB( 200, 200, 200 );
        ACanvas->DrawImage( imageList, left, top, imageIndex, true );
        ACanvas->DrawComplexFrame( AViewInfo->BoundsRect, borderSeparator, borderSeparator, ( TcxBorders( ) << bLeft << bTop << bRight << bBottom ) );
        ADone = true;
        return;
        }

        Thanks in advance

        Answers approved by DevExpress Support

        created 6 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.

          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.