Recent

Author Topic: BGRABitmapLibrary (.dll and so on...)  (Read 11544 times)

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
BGRABitmapLibrary (.dll and so on...)
« on: April 29, 2015, 02:04:59 pm »
In the BGRA-Controls package there is a project called "bgra_pascalscript_library" that compiles bgrabitmap.dll (and in other os's with different extensions..).

Important things:
  • It uses bgrapascalscript.pas: basically we reuse the code that is being used in the bgrabitmap implementation for pascal script because it works the same way.
  • For that is named bgra_pascalscript_library. But it makes a library called just "bgrabitmap".

Current stage:
* Tested with Visual Studio C# 2013. The unit with the classes is available in the subdirectory "c#".
* Tested with Lazarus. The unit with the functions is available in the subdirectory "pascal".
* Now is compatible as Java library.
« Last Edit: May 01, 2015, 01:26:10 pm by 007 »

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #1 on: April 29, 2015, 06:47:50 pm »
Hi! It looks great.

There was a small thing when trying to compile:
bgra_pascalscript_library.lpr(115,37) Error: Identifier not found "bgra_DestroyAll"
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #2 on: April 29, 2015, 06:49:51 pm »
Hi! It looks great.

There was a small thing when trying to compile:
bgra_pascalscript_library.lpr(115,37) Error: Identifier not found "bgra_DestroyAll"

Ok. It is using bgrapascalscript.pas that is in the root directory of bgracontrols, so maybe you have an outdated version or I've commited it wrong?

Edit: It's my fault. I'm updating the repository now.
« Last Edit: April 29, 2015, 06:51:59 pm by 007 »

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #3 on: April 29, 2015, 06:55:36 pm »
It is not obvious to know what we commit or not, so it is useful to have someone else to check out what we do  8)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #4 on: April 29, 2015, 07:33:10 pm »
Yes it is.

Well I think I finished the first step. Now C# and pascal headers has all the filters ready to use. Just compile the library, add the bgrabitmap.cs in your C# ide, bgrabitmaplibrary.pas in lazarus, put the dll in the same folder as the executable and it should work.

Now the thing is adding the drawing stuff, that is a lot! :)

Also Fred vS has a question about how we can use fpGUI instead of LCL in a Library? It is configurable in some way or is not possible? Reaching the fpgui part of BGRABitmap...

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #5 on: April 29, 2015, 07:53:48 pm »
Quote
Also Fred vS has a question about how we can use fpGUI instead of LCL in a Library?

Hum, the question was not to use fpGUI instead of LCL but not to use LCL.  :-X
Also, for your library i see more something nude, without any widgetset (LCL, fpGUI or whatever) , like Agg library.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #6 on: April 29, 2015, 08:23:58 pm »
Ah, well there some progress towards have no LCL, but it is not there yet. However I think it would be possible.
Conscience is the debugger of the mind

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #7 on: April 29, 2015, 08:26:13 pm »
Quote
However I think it would be possible.

Hum, i think that nothing is impossible for BGRABitmap  :)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #8 on: April 29, 2015, 08:33:18 pm »
Ahah  :D

By the way, does the linux version compile now for you?
Conscience is the debugger of the mind

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #9 on: April 29, 2015, 08:46:52 pm »
Quote
By the way, does the linux version compile now for you?

I will jump into it this night.

Write-you later.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #10 on: April 29, 2015, 11:26:01 pm »
Quote
By the way, does the linux version compile now for you?
Have try to compile bgra_pascalscript_library.lpr on Linux Mint 64 bit =>

Quote
../bgrabitmap/bgrapath.pas(2535,5) Fatal: Internal error 2009112601

Hum, not any idea what is error 2009112601  :-\

bgrapath.pas(2535,5) =>
Code: [Select]
procedure TBGRAPath.arc(const arcDef: TArcDef);
var transformedArc: TArcElement;
begin
... 
    SetLastCoord(ArcEndPoint(arcDef)); // here error
  end;
end;           

Fre;D

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #11 on: April 30, 2015, 12:14:36 am »
OK, to go further i commented =>
Code: [Select]
// SetLastCoord(ArcEndPoint(arcDef));
Now i have that error =>
Quote
../bgrabitmap/bgrapath.pas(2595,32) Error: Call by var for arg no. 1 has to match exactly: Got "LongInt" expected "Int64"

/bgrabitmap/bgrapath.pas(2595,32)  =>
Code: [Select]
  until not GoToNextElement(pos);   
OK, to go further i changed =>
Code: [Select]
var
pos : int64;

Now it compiles but at linking i have that error =>
Quote
/usr/bin/ld: .../bgra-controls-code-86/lib/x86_64-linux/2.6.4/bgrapascalscript.o: relocation R_X86_64_32S against `U_BGRAPASCALSCRIPT_BITMAPARRAY' can not be used when making a shared object; recompile with -fPIC

Adding -fPIC compiler-parameter did not help...

Fre;D
« Last Edit: April 30, 2015, 12:17:17 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #12 on: April 30, 2015, 12:58:00 am »
Sorry to monopolize  :-[

Quote
   
Quote
../bgrabitmap/bgrapath.pas(2535,5) Fatal: Internal error 2009112601
=>   SetLastCoord(ArcEndPoint(arcDef)); // here error

Hum, not any idea what is error 2009112601  :-\
 

=> It seems to be something wrong with Inline
Code: [Select]
function SetLastCoord(ACoord: TPointF): TPointF; inline; => gives error.

But
Code: [Select]
function SetLastCoord(ACoord: TPointF): TPointF; => gives NO error.

PS : But still error after compil => at linking  :-\


I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #13 on: April 30, 2015, 01:22:46 am »
Yes, "pos" variable is in fact IntPtr. You can download the latest version if you like to have this fix.

Others erros could be related to the version of the compiler?
Conscience is the debugger of the mind

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: BGRABitmapLibrary (.dll and so on...)
« Reply #14 on: April 30, 2015, 01:33:17 am »
Quote
Others erros could be related to the version of the compiler?
Hmmm, for function SetLastCoord(ACoord: TPointF): TPointF; inline; , maybe, i use fpc 2.6.4.

For error while linking i could try with fpc 3.0.1, maybe it is fixed (but for that updated-LazUtils is needed...).

Hum, LCL dependencies do it harder for the linker.

Quote
You can download the latest version if you like to have this fix.
Downloaded bgrabitmap8.4 one hour ago => same error...

Fre;D
« Last Edit: April 30, 2015, 01:38:57 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018