Recent

Author Topic: TBGRABitmap + NoGUI  (Read 29187 times)

Silvio Clécio

  • Guest
TBGRABitmap + NoGUI
« on: January 29, 2013, 01:19:31 pm »
Is TBGRABitmap compatible with NoGUI?

Please see:

http://bugs.freepascal.org/view.php?id=23775

Thank you!

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #1 on: January 29, 2013, 07:13:40 pm »
It's not compatible yet.

Is there an easy way to check that it is in NoGUI mode ? So for example, system text rendering could be deactivated.
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #2 on: January 29, 2013, 07:15:31 pm »
I don't know guy. :/

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #3 on: January 29, 2013, 07:29:33 pm »
Hmm, and how to do a NoGUI application ?
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #4 on: January 29, 2013, 07:49:39 pm »

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #5 on: January 29, 2013, 07:57:07 pm »
Ok, i've updated BGRABitmap on subversion. Try with the latest version.
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #6 on: January 29, 2013, 08:02:19 pm »
I'll test it now ...  :D

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #7 on: January 29, 2013, 08:06:01 pm »
Oops, which the correct SVN link to download it?  :-[

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #8 on: January 29, 2013, 08:22:06 pm »
The last revision is 457?

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #9 on: January 29, 2013, 09:03:07 pm »
455, I guess.

Note that you must avoid using text functions
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #10 on: January 29, 2013, 09:08:08 pm »
Hm... strange, I downloaded from here:

https://lazpaint.svn.sourceforge.net/svnroot/lazpaint

The last commit (in 2012):

http://imagebin.org/244708

I did not find your changes. :(

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #11 on: January 29, 2013, 09:20:06 pm »
I found the correctly link:

svn://svn.code.sf.net/p/lazpaint/code

 :-[ :-[ :-[

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #12 on: January 29, 2013, 09:29:03 pm »
Now the error is:
Code: [Select]
C:\Users\silvioprog\Desktop\nogui_bgra>noguidemo.exe
TRasterImage.BitmapHandleNeeded: Unable to create handles, using default
TRasterImage.BitmapHandleNeeded: Unable to create handles, using default
[FORMS.PP] ExceptionOccurred
  Sender=EInvalidOperation
  Exception=Canvas does not allow drawing
  Stack trace:
  $00491984  TCANVAS__REQUIREDSTATE,  line 1672 of ./include/canvas.inc
  $00491BA0  TCANVAS__TEXTEXTENT,  line 1731 of ./include/canvas.inc
  $0048F478  TCANVAS__DOGETTEXTSIZE,  line 471 of ./include/canvas.inc
  $0042617F
  $006033FD
  $00603481
  $005B9640
  $005C676C
  $00439604  TBASICDRAWER__TEXTEXTENT,  line 367 of C:/lazarus/components/tachar
t/tadrawutils.pas
  $0053CCB4  TCHARTTEXTELEMENT__MEASURELABEL,  line 427 of C:/lazarus/components
/tachart/tatextelements.pas
  $00538FBB  TCUSTOMCHARTAXISMARKS__MEASURE,  line 577 of C:/lazarus/components/
tachart/tachartaxisutils.pas
  $00535F9D  TCHARTAXIS__MEASURE,  line 698 of C:/lazarus/components/tachart/tac
hartaxis.pas
  $005373C4  TCHARTAXISLIST__MEASURE,  line 1028 of C:/lazarus/components/tachar
t/tachartaxis.pas
  $004325E1  TCHART__PREPAREAXIS,  line 1203 of C:/lazarus/components/tachart/ta
graph.pas
  $00430D2A  TCHART__DRAW,  line 772 of C:/lazarus/components/tachart/tagraph.pa
s
  $00401C42  main,  line 48 of noguidemo.lpr
TApplication.HandleException Canvas does not allow drawing
  Stack trace:
  $00491984  TCANVAS__REQUIREDSTATE,  line 1672 of ./include/canvas.inc
  $00491BA0  TCANVAS__TEXTEXTENT,  line 1731 of ./include/canvas.inc
  $0048F478  TCANVAS__DOGETTEXTSIZE,  line 471 of ./include/canvas.inc
  $0042617F
  $006033FD
  $00603481
  $005B9640
  $005C676C
  $00439604  TBASICDRAWER__TEXTEXTENT,  line 367 of C:/lazarus/components/tachar
t/tadrawutils.pas
  $0053CCB4  TCHARTTEXTELEMENT__MEASURELABEL,  line 427 of C:/lazarus/components
/tachart/tatextelements.pas
  $00538FBB  TCUSTOMCHARTAXISMARKS__MEASURE,  line 577 of C:/lazarus/components/
tachart/tachartaxisutils.pas
  $00535F9D  TCHARTAXIS__MEASURE,  line 698 of C:/lazarus/components/tachart/tac
hartaxis.pas
  $005373C4  TCHARTAXISLIST__MEASURE,  line 1028 of C:/lazarus/components/tachar
t/tachartaxis.pas
  $004325E1  TCHART__PREPAREAXIS,  line 1203 of C:/lazarus/components/tachart/ta
graph.pas
  $00430D2A  TCHART__DRAW,  line 772 of C:/lazarus/components/tachart/tagraph.pa
s
  $00401C42  main,  line 48 of noguidemo.lpr
Exception at 00491984: EInvalidOperation:
Canvas does not allow drawing.

C:\Users\silvioprog\Desktop\nogui_bgra>

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #13 on: January 29, 2013, 09:31:56 pm »
The full demo to reproduce it:

https://www.dropbox.com/s/7m353hvt50k8152/nogui_bgra.zip

Environment:

Lazarus 1.1 r39272 FPC 2.7.1 i386-win32-win32/win64

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #14 on: January 29, 2013, 09:40:12 pm »
> Note that you must avoid using text functions

Yes, I changed my demo to:

Code: [Select]
program noguidemo;

{$mode objfpc}{$H+}

uses
  Interfaces,
  Classes,
  FPCanvas,
  FPImage,
  FPImgCanv,
  TATools,
  TAGraph,
  TASeries,
  TADrawerCanvas,
  TADrawUtils,
  BGRABitmap,
  TAChartUtils,
  TADrawerBGRA;

var
  chart: TChart;
  bs: TBarSeries;
  img: TBGRABitmap;
  d: IChartDrawer;
begin
  chart := TChart.Create(nil);
  chart.Color := $FFA0A0;
  chart.BackColor := $FFFFFF;
  bs := TBarSeries.Create(nil);
  chart.AddSeries(bs);
  bs.AddXY(1, 10);
  bs.AddXY(2, 7);
  bs.AddXY(3, 8);
  img := TBGRABitmap.Create(chart.Width, chart.Height);
  d := TBGRABitmapDrawer.Create(img);
  chart.Draw(d, Rect(0, 0, chart.Width, chart.Height));
  img.SaveToFile('test.png');
  img.Free;
  bs.Free;
  chart.Free;
end.

And the error is:

Code: [Select]
C:\Users\silvioprog\Desktop\nogui_bgra>noguidemo.exe
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000
  $0053C0AC  TCHARTTEXTELEMENT__APPLYLABELFONT,  line 279 of C:/lazarus/componen
ts/tachart/tatextelements.pas
  $00539969  TGENERICCHARTMARKS$3$CRC16F2AB4F__APPLYLABELFONT,  line 594 of C:/l
azarus/components/tachart/tatextelements.pas
  $0053CABC  TCHARTTEXTELEMENT__MEASURELABEL,  line 426 of C:/lazarus/components
/tachart/tatextelements.pas
  $00538DDB  TCUSTOMCHARTAXISMARKS__MEASURE,  line 577 of C:/lazarus/components/
tachart/tachartaxisutils.pas
  $00535DBD  TCHARTAXIS__MEASURE,  line 698 of C:/lazarus/components/tachart/tac
hartaxis.pas
  $005371E4  TCHARTAXISLIST__MEASURE,  line 1028 of C:/lazarus/components/tachar
t/tachartaxis.pas
  $00432451  TCHART__PREPAREAXIS,  line 1203 of C:/lazarus/components/tachart/ta
graph.pas
  $00430B9A  TCHART__DRAW,  line 772 of C:/lazarus/components/tachart/tagraph.pa
s
  $00401AAC  main,  line 36 of noguidemo.lpr
TApplication.HandleException Access violation
  Stack trace:
  $00000000
  $0053C0AC  TCHARTTEXTELEMENT__APPLYLABELFONT,  line 279 of C:/lazarus/componen
ts/tachart/tatextelements.pas
  $00539969  TGENERICCHARTMARKS$3$CRC16F2AB4F__APPLYLABELFONT,  line 594 of C:/l
azarus/components/tachart/tatextelements.pas
  $0053CABC  TCHARTTEXTELEMENT__MEASURELABEL,  line 426 of C:/lazarus/components
/tachart/tatextelements.pas
  $00538DDB  TCUSTOMCHARTAXISMARKS__MEASURE,  line 577 of C:/lazarus/components/
tachart/tachartaxisutils.pas
  $00535DBD  TCHARTAXIS__MEASURE,  line 698 of C:/lazarus/components/tachart/tac
hartaxis.pas
  $005371E4  TCHARTAXISLIST__MEASURE,  line 1028 of C:/lazarus/components/tachar
t/tachartaxis.pas
  $00432451  TCHART__PREPAREAXIS,  line 1203 of C:/lazarus/components/tachart/ta
graph.pas
  $00430B9A  TCHART__DRAW,  line 772 of C:/lazarus/components/tachart/tagraph.pa
s
  $00401AAC  main,  line 36 of noguidemo.lpr
Exception at 00000000: EAccessViolation:
Access violation.

C:\Users\silvioprog\Desktop\nogui_bgra>
« Last Edit: January 29, 2013, 09:46:41 pm by silvioprog »

 

TinyPortal © 2005-2018