Page 1 of 2

Error transferring internal Bitmap using BitBlt

Posted: Fri Nov 12, 2010 9:50 am
by 10548296
Hi

We get the following error message (message box) using Delphi XE built-in TeeChart:
Error transferring internal Bitmap using BitBlt (C:\Builds\TpAddons\TeeChart\TeCanvas.pas, line 6316)

The same code runs fine with Delphi 2007. We do not have the source code for that TeeChart version so I don't know what causes the failure. Is this a bug and is there a known work-around?

Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Fri Nov 12, 2010 10:13 am
by narcis
Hi Hein,

Can you please attach a simple example project we can run "as-is" to reproduce the problem and debug it here?

Thanks in advance.

Re: Error transferring internal Bitmap using BitBlt

Posted: Mon Nov 15, 2010 10:19 am
by 10548296
I really don't have any suitable example projects, but the error has appeared in at least three different applications and in both Windows XP and Windows 7 64-bit environments. The error only appears a few times a week and is not related to user input (zoom/pan) or adding data to the chart. We use time stamps as X values and a few thousand samples (2000+) using one serie. The following DFM output is directly from a project where the error happens regularly:

Code: Select all

  object Chart1: TChart
    Left = 8
    Top = 8
    Width = 944
    Height = 405
    Legend.Visible = False
    Title.Text.Strings = (
      'TChart')
    Title.Visible = False
    View3D = False
    TabOrder = 0
    ColorPaletteIndex = 13
    object Series1: TFastLineSeries
      Marks.Arrow.Visible = True
      Marks.Callout.Brush.Color = clBlack
      Marks.Callout.Arrow.Visible = True
      Marks.Visible = False
      LinePen.Color = 10708548
      XValues.DateTime = True
      XValues.Name = 'X'
      XValues.Order = loAscending
      YValues.Name = 'Y'
      YValues.Order = loNone
    end
  end
It would help us if we could prevent the error message from appearing.

Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Tue Nov 16, 2010 3:51 pm
by narcis
Hi Hein,

I'm not able to reproduce the problem here using the code you posted. Delphi XE includes TeeChart Std v9 (aka v2010). While Delphi 2007 includes TeeChart Std v7. Which TeeChart version are you using in Delphi 2007? It would be very helpful if you could try to arrange a simple example project we can run "as-is" to reproduce the problem and debug it here. Also, you may want to try using latest TeeChart 2010 VCL maintenance release available at the client area for both registered and evaluation version users.

Re: Error transferring internal Bitmap using BitBlt

Posted: Wed Nov 17, 2010 7:41 am
by 10548296
Hi

I was able to reproduce the problem with the attached source code. It did not watch it continuously, but it took no more than 30 minutes before the error appeared. The test was run on a Windows XP computer. We have now confirmed the problem on four computers (XP and Win7 x64).

I hope you are able to reproduce the problem now.
TeeChartBitBltError.zip
Project for reproducing TeeChart BitBlt error message in Delphi XE.
(1.43 KiB) Downloaded 767 times
Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Wed Nov 17, 2010 9:04 am
by 10548296
This QC report may affect this bug. Is is fixed in Delphi XE Update 1.
http://qc.embarcadero.com/wc/qcmain.aspx?d=88382

I don't know if this applies to the TeeChart DCUs, but I have not been able to reproduce the error after installing Update 1. I am not using debug DCUs.

Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Wed Nov 17, 2010 9:08 am
by 10548296
NarcĂ­s wrote:Delphi XE includes TeeChart Std v9 (aka v2010). While Delphi 2007 includes TeeChart Std v7. Which TeeChart version are you using in Delphi 2007?
We used the included TeeChart Std v7 and TeeChart Pro v8 in Delphi 2007.

Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Wed Nov 17, 2010 10:04 am
by narcis
Hi Hein,

Thanks for your feedback. As far as I know nothing changed in TeeChart for update 1 so it must be an Embarcadero thing but Quality Central doesn't mark the issue as fixed yet. Anyway, I couldn't reproduce the issue here either running your project with Delphi XE + Update 1 with default TeeChart v9 Std for about 45 minutes nor running it in Delphi 7 with TeeChart v9 Pro for about 30 minutes. If you find a consistent way to reproduce the issue again don't hesitate to let us know.

Thanks in advance.

Re: Error transferring internal Bitmap using BitBlt

Posted: Wed Nov 17, 2010 10:29 am
by 10548296
I think QC 88382 is fixed since it is in the list of fixed bugs in Delphi and C++ Builder XE Update 1:
http://edn.embarcadero.com/de/article/40984/

If Embarcadero compiles TeeChart DCUs for their releases, then this issue should also affect TeeChart. Anyway, if assertions are turned off, the error is only hidden, and not fixed. You may want to look at the specific code line where the assertion happens to make sure it is not a serious error. I know I will do the same when we get the V9 source code.

Thanks for your help.

Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Wed Nov 17, 2010 11:34 am
by narcis
Hi Hein,
I think QC 88382 is fixed since it is in the list of fixed bugs in Delphi and C++ Builder XE Update 1:
http://edn.embarcadero.com/de/article/40984/
Ok, thanks. They haven't updated this 88382 status in QC then :wink:.
If Embarcadero compiles TeeChart DCUs for their releases, then this issue should also affect TeeChart.
Yes, probably but what Embarcadero includes in their products is beyond our control.
Anyway, if assertions are turned off, the error is only hidden, and not fixed. You may want to look at the specific code line where the assertion happens to make sure it is not a serious error. I know I will do the same when we get the V9 source code.
Yes, the problem is that TeCanvas.pas is one of the core units of TeeChart. Therefore it's in constant evolution and I'm not sure which will be current line corresponding to line number 6316 in the version shipped with Delphi XE. We should be able to reproduce this debugging the sources. Anyway, I installed our current v9 sources in Delphi XE, compiled the application with debugging assertions enabled and ran the test for around 40 minutes with no error.
I know I will do the same when we get the V9 source code.
If you can reproduce the issue don't hesitate to let us know.

Re: Error transferring internal Bitmap using BitBlt

Posted: Fri Nov 19, 2010 8:33 am
by 10548296
My test application has run for two days without any error. I am pretty sure the problem is solved with RAD Studio XE Update 1.

Regards,
Hein Gustavsen

Re: Error transferring internal Bitmap using BitBlt

Posted: Fri Nov 19, 2010 9:18 am
by narcis
Hi Hein,

Thank you very much for your feedback. I'm glad to hear the problem has been solved at your end.

Re: Error transferring internal Bitmap using BitBlt

Posted: Mon Nov 29, 2010 5:55 pm
by 16556791
Hello,
we have this problem, too. But we are using Delphi 2010 with TeeChartPro 2010 and therefore ther is no patch from Embacadero).
And the code snippet that is shown as source of the error is in line 6464 of TeCanvas,pas (bolt):

Procedure TTeeCanvas3D.TransferBitmap(ALeft,ATop:Integer; ACanvas:TCanvas);
{$IFOPT C+}
var tmpRes : LongBool;
{$ENDIF}
begin
{$IFNDEF CLX}

{$IFDEF MONITOR_REPAINTS}
Inc(TeeMonitor);
FBitmap.Canvas.TextOut(0,0,IntToStr(TeeMonitor));
{$ENDIF}

// Assert(FBitmap.PixelFormat=pfDevice,'Buffer Bitmap PixelFormat <> pfDevice');

{$IFOPT C+}
tmpRes:=
{$ENDIF}
BitBlt( ACanvas.Handle,ALeft,ATop,
FBitmap.Width,
FBitmap.Height,
FBitmap.Canvas.Handle,0,0,SRCCOPY);

{$IFOPT C+}
Assert(tmpRes,'Error transferring internal Bitmap using BitBlt');
{$ENDIF}

{$ELSE}
QPainter_drawPixmap(ACanvas.Handle, ALeft, ATop, FBitmap.Handle, 0, 0,
FBitmap.Width, FBitmap.Height);
{$ENDIF}
end;


It could be that the error is dependent if we work with windows remote desktop or not. The error happens only if we use remote desktop and TeeCahrt is visible but the client remote desktop with the running TeeChart is iconic, the error is not happening if the TeeChart is not visible.

Can you help us?

Your sincerely

Willi

Re: Error transferring internal Bitmap using BitBlt

Posted: Tue Nov 30, 2010 9:20 am
by narcis
Hi Willi,

Are you using latest TeeChart Pro 2010 maintenance release available at the client area, which is v2010.01.11004? Do you have an example project with which we can reproduce the problem here or does it occur using Hein Gustavsen's example at your end?

Thanks in advance.

Re: Error transferring internal Bitmap using BitBlt

Posted: Tue Nov 30, 2010 12:08 pm
by narcis
Hi Willi,

After further testing I could finally reproduce the issue here using Remote Desktop and Hein Gustavsen's example. I have added the issue (TV52015296) to the defect list and will continue investigating it. I will get back to this thread if I find anything relevant.