GDI+ standard library 1.45 by tic

Post your working scripts, libraries and tools
robodesign
Posts: 656
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

24 May 2020, 05:35

R0nya wrote:
17 May 2020, 17:37
This one works for me
You gave me an incomplete function. However I found it entirely on: https://github.com/MasterFocus/AutoHotkey/blob/master/Functions/Gdip_ImageSearch/Gdip_ImageSearch.ahk
It does not qualify to add it, because it relies on Machine Code and it does not include editions for x32 and x64.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
malcev
Posts: 621
Joined: 12 Aug 2014, 12:37

Re: GDI+ standard library 1.45 by tic

24 May 2020, 05:39

robodesign wrote:
24 May 2020, 05:35
It does not qualify to add it, because it relies on Machine Code and it does not include editions for x32 and x64.
It has:

Code: Select all

        if ( A_PtrSize == 8 ) ; x64, after comma
            MCode_ImageSearch := SubStr(MCode_ImageSearch,InStr(MCode_ImageSearch,",")+1)
        else ; x86, before comma
            MCode_ImageSearch := SubStr(MCode_ImageSearch,1,InStr(MCode_ImageSearch,",")-1)
https://github.com/MasterFocus/AutoHotkey/blob/master/Functions/Gdip_ImageSearch/Gdip_ImageSearch.ahk#L548
guest3456
Posts: 3123
Joined: 09 Oct 2013, 10:31

Re: GDI+ standard library 1.45 by tic

24 May 2020, 06:48

for GdipImageSearch, keep in mind that MasterFocus explicitly chose a copyleft license with a viral component, ala the GPL, which means that if you build upon that func, you must also release your code publicly under the same terms. that's why i hadn't added it to the v2 version of the gdip lib, as i don't believe its compatible with other freely shared unlicensed code. i'm not a fan of these licenses, but i understand why a user would choose it

robodesign
Posts: 656
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

24 May 2020, 06:55

@malcev. Okay, thank you. My bad - I admit I did not peruse the code.

@guest3456. Thank you for this heads-up about this. Does this mean that I cannot include functions / code licensed under GPL in the library ? I'll mention who made it and give a link to the source, and I'll mention it is under GPL license. Is this fine? I'm not proficient in such matters.....

Right now I'm working on the ahk v2 edition on the library and I'm trying to release it soon.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
guest3456
Posts: 3123
Joined: 09 Oct 2013, 10:31

Re: GDI+ standard library 1.45 by tic

24 May 2020, 07:05

robodesign wrote:
24 May 2020, 06:55
@guest3456. Thank you for this heads-up about this. Does this mean that I cannot include functions / code licensed under GPL in the library ? I'll mention who made it and give a link to the source, and I'll mention it is under GPL license. Is this fine? I'm not proficient in such matters.....
i am not a lawyer myself. from here:
https://www.gnu.org/licenses/gpl-faq.en.html
If a library is released under the GPL (not the LGPL), does that mean that any software which uses it has to be under the GPL or a GPL-compatible license? (#IfLibraryIsGPL)

Yes, because the program actually links to the library. As such, the terms of the GPL apply to the entire combination. The software modules that link with the library may be under various GPL compatible licenses, but the work as a whole must be licensed under the GPL.
i take that to mean that the entire compilation library itself would have to be GPL'd... but since we're not the authors of everyone else's code, we certainly don't have the right to apply a license to their code that they wrote. especially not a restrictive license like this.

the fact that the GPL has so many issues, and also requires such a long webpage of FAQs, tells me all i need to know about that license: its complicated and cumbersome. there are many words written all over the web about the pain in the ass that is the GPL. i believe the license MasterFocus chose has similar complications

this is why i like the WTFPL :)



sidenote:

AutoHotkey itself is licensed under the GPL, and its been common over the years for people to ask whether or not every script they write is forced to also be licensed under the GPL as well. according to that same link above:
If a programming language interpreter is released under the GPL, does that mean programs written to be interpreted by it must be under GPL-compatible licenses? (#IfInterpreterIsGPL)

When the interpreter just interprets a language, the answer is no. The interpreted program, to the interpreter, is just data; a free software license like the GPL, based on copyright law, cannot limit what data you use the interpreter on. You can run it on any data (interpreted program), any way you like, and there are no requirements about licensing that data to anyone.

robodesign
Posts: 656
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

24 May 2020, 11:09

Thank you. I'll not include it then.

I just pushed a new version of the GDI+ library... and now the repository includes a specific edition for v2, but I have no projects to test it with thoroughly. Therefore, I am quite confident that bugs are still present. Pull requests are welcome.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
xelowek
Posts: 10
Joined: 04 Jun 2020, 15:38

Re: GDI+ standard library 1.45 by tic

04 Jul 2020, 10:12

Hi, Marius.

Maybe i wrong, but it seems that there is an error in the Gdip_TextToGraphics function (library v.1.84). Vertical alignment works incorrectly (the 'Top', 'Up', 'Bottom', 'Down' parameters).

line 4062

Code: Select all

; original: always aligned on the 'top edge' of canvas
ypos := 0
; must be
ypos += 0
line 4064

Code: Select all

; original: always aligned on the 'top edge + height (parameter from func call)'
ypos := Height-ReturnRC[4]
; must be
ypos += Height-ReturnRC[4]
line 4056-4068

Code: Select all

If vPos
   {
      ReturnRC := StrSplit(ReturnRC, "|")
      if (vPos[0] = "vCentre") || (vPos[0] = "vCenter")
         ypos += (Height-ReturnRC[4])//2
      else if (vPos[0] = "Top") || (vPos[0] = "Up")
         ypos := 0 ; <------------------------------------------------------
      else if (vPos[0] = "Bottom") || (vPos[0] = "Down")
         ypos := Height-ReturnRC[4] ; <-------------------------------------

      CreateRectF(RC, xpos, ypos, Width, ReturnRC[4])
      ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hStringFormat, RC)
   }
guest3456
Posts: 3123
Joined: 09 Oct 2013, 10:31

Re: GDI+ standard library 1.45 by tic

04 Jul 2020, 11:28

xelowek wrote:
04 Jul 2020, 10:12
Maybe i wrong, but it seems that there is an error in the Gdip_TextToGraphics function (library v.1.84). Vertical alignment works incorrectly (the 'Top', 'Up', 'Bottom', 'Down' parameters).
its been discussed extensively a few years ago, see this github issue for various different fixes:

https://github.com/mmikeww/AHKv2-Gdip/issues/17

robodesign
Posts: 656
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

04 Jul 2020, 11:53

@boiler and @Guest3456 . Yes, I am aware of this issue and my next version release will have this fixed. I saw the disscussion Guest mentioned and I already chose for the next release to use += ...

However , right now I am working on new functions with MCode for alpha masking, apply blending modes and so on. When I am ready I will release the update.

Thank you for the report. If you find other errors, please let me know .

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Br4d0z and 29 guests