View Issue Details

IDProjectCategoryView StatusLast Update
0006091JEDI VCL00 JVCL Componentspublic2015-09-14 14:11
ReporteraltaveronAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version3.47 
Target VersionFixed in Version 
Summary0006091: Incorrect background of the image on the grid indicator column
DescriptionThe grid indicator column displays an incorrect background of the image for the current record. Please look to the screenshot. Background of the image should be transparent.
TagsNo tags attached.

Relationships

related to 0006182 resolvedobones Incorrect drawing on TJvDBGrid's title after mouse cursor 

Activities

2013-02-25 01:22

 

issue.png (4,574 bytes)
issue.png (4,574 bytes)

altaveron

2013-02-25 01:44

reporter   ~0020446

It's JVDBGRIDMSARROW resource image and one more (as on the screenshot).

altaveron

2013-02-25 02:25

reporter   ~0020447

There are 3 images total: 'JvDBGridMSDOT' and 'JvDBGridMSARROW' from resource file and one more (as on the screenshot).

altaveron

2013-07-16 14:24

reporter   ~0020573

How to increase priority of the issue?

altaveron

2013-08-16 20:39

reporter   ~0020582

It seems the error raises from using TCustomDBGrid.DrawCell method, and then over the basic image TJvDBGrid draws the images with transparent background from JvDBGrid.res: JvDBGridMSDOT ? JvDBGridMSARROW.

altaveron

2013-08-21 19:40

reporter   ~0020588

There are two errors: on TCustomDBGrid.DrawCell and on TJvDBGrid.DrawCell. To fix the second error it's enough to comment the following line:

  // FMsIndicators.BkColor := FixedColor;

altaveron

2013-08-21 20:02

reporter   ~0020589

FixedColor should be set to reproduce the issue on Windows XP. And the issue will be more noticeable on Windows XP with FixedColor = clRed.

altaveron

2013-08-21 20:16

reporter   ~0020592

The correct version of the previous comment:

FixedColor should be set to reproduce the issue on Windows XP. And the issue will be more noticeable on Windows 7+ with FixedColor = clRed.

Arioch

2013-08-31 04:03

developer   ~0020612

> How to increase priority of the issue?

By fixing it yourself. Delphi is on decline, and such are all FLOSS and commercial libraries...

Arioch

2013-08-31 04:03

developer   ~0020613

Attach demo project, showing the bug please

2013-09-04 04:32

 

Project1.zip (83,912 bytes)

altaveron

2013-09-04 04:33

reporter   ~0020633

Arioch, done!

altaveron

2013-09-27 15:12

reporter   ~0020643

Can anybody fix it for money?

obones

2013-12-16 12:08

administrator   ~0020852

I'm sorry, but the issue seems to come from TDBGrid itself, I couldn't find an easy way to circumvent this.
I mean, in your example, replace TJvDBGrid by TDBGrid, and you'll see the same issue.

altaveron

2014-03-03 10:23

reporter   ~0020922

The FIX:

procedure TJvDBGrid.DoDrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);
var
  aBitmap: TBitmap;
  x, y: Integer;
  aPixel: PRGBTriple;

...

  // fix image background issue comes from TDBGrid
  if DataLink.Active and (ARow - TitleOffset = Datalink.ActiveRecord) then
    if (dgIndicator in Options) and (ACol = 0) then
    begin
      aBitmap := TBitmap.Create;
      try
        aBitmap.PixelFormat := pf24bit;
        aBitmap.Height := ARect.Height;
        aBitmap.Width := ARect.Width;
        aBitmap.Canvas.CopyRect(TRect.Create(0, 0, aBitmap.Width, aBitmap.Height), Canvas, ARect);
        for y := 0 to aBitmap.Height - 1 do
          for x := 0 to aBitmap.Width - 1 do
          begin
            aPixel := aBitmap.ScanLine[y];
            Inc(aPixel, x);
            if // fix image background issue with default color
               // Abs() <= 1 condition is required for Windows XP
               ((Abs($f0 - aPixel^.rgbtRed) <= 1) and (Abs($f0 - aPixel^.rgbtGreen) <= 1) and (Abs($f0 - aPixel^.rgbtBlue) <= 1)) or
               // fix image background issue with FixedColor
               ((Abs(GetRValue(FixedColor) - aPixel^.rgbtRed) <= 1) and (Abs(GetGValue(FixedColor) - aPixel^.rgbtGreen) <= 1) and (Abs(GetBValue(FixedColor) - aPixel^.rgbtBlue) <= 1)) then
              aPixel^ := PRGBTriple(aBitmap.ScanLine[y])^;
          end;
        Canvas.Draw(ARect.Left, ARect.Top, aBitmap);
      finally
        aBitmap.Free;
      end;
    end;
end;

altaveron

2014-03-03 11:16

reporter   ~0020925

http://qc.embarcadero.com/wc/qcmain.aspx?d=122886

obones

2015-09-14 14:11

administrator   ~0021200

Well, if EMB won't fix it, we can't do much about it

Issue History

Date Modified Username Field Change
2013-02-25 01:22 altaveron New Issue
2013-02-25 01:22 altaveron File Added: issue.png
2013-02-25 01:44 altaveron Note Added: 0020446
2013-02-25 02:25 altaveron Note Added: 0020447
2013-07-16 14:24 altaveron Note Added: 0020573
2013-08-16 20:39 altaveron Note Added: 0020582
2013-08-21 19:40 altaveron Note Added: 0020588
2013-08-21 20:02 altaveron Note Added: 0020589
2013-08-21 20:16 altaveron Note Added: 0020592
2013-08-31 04:03 Arioch Note Added: 0020612
2013-08-31 04:03 Arioch Note Added: 0020613
2013-09-04 04:32 altaveron File Added: Project1.zip
2013-09-04 04:33 altaveron Note Added: 0020633
2013-09-27 15:12 altaveron Note Added: 0020643
2013-12-13 11:05 obones Status new => acknowledged
2013-12-13 14:43 obones Relationship added related to 0006182
2013-12-16 12:08 obones Note Added: 0020852
2013-12-16 12:08 obones Status acknowledged => feedback
2014-03-03 10:23 altaveron Note Added: 0020922
2014-03-03 11:16 altaveron Note Added: 0020925
2014-12-04 16:38 obones Status feedback => acknowledged
2015-09-14 14:11 obones Note Added: 0021200
2015-09-14 14:11 obones Status acknowledged => resolved
2015-09-14 14:11 obones Resolution open => won't fix
2015-09-14 14:11 obones Assigned To => obones