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
Thanks, Cesar. Indeed, the current version of our TcxCheckBox control does not support semi-transparent images (S172824). We will check if we can find an appropriate way to improve the current drawing mechanism.
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
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.
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