GDI+ standard library 1.45 by tic

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

Re: GDI+ standard library 1.45 by tic

23 Aug 2019, 03:39

Thank you , Learning One! I fixed it.

I just pushed a new version with some fixes. Some functions were incorrectly named... and I also reduced the number of errors thrown by AHK v2. For some reason, I still get on v2 "invalid index" for ... «PropTags[0x0001] := "GPS LatitudeRef"» [line 3203 in Gdip_GetPropertyTagName()]... and I have no idea how to fix it.

https://github.com/marius-sucan/AHK-GDIp-Library-Compilation

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
User avatar
nnnik
Posts: 4253
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: GDI+ standard library 1.45 by tic

23 Aug 2019, 04:19

https://lexikos.github.io/v2/docs/objects/Array.htm < See
You should probably just replace that array with a map.
Recommends AHK Studio
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

29 Aug 2019, 10:32

I used var := {key:value, ... }. Throws no errors now on AHK v2 a104.

I updated the library to v1.58. I fixed other errors as well.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
User avatar
jeeswg
Posts: 6718
Joined: 19 Dec 2016, 01:58
Location: UK

Re: GDI+ standard library 1.45 by tic

03 Sep 2019, 10:43

I mentioned adding #Warn support, previously, i.e. adding in var := 0 and local:
GDI+ standard library 1.45 by tic - Page 14 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=6517&p=267400#p267400

By having #Warn enabled, you spot problems, like the one I found in Gdip_DrawImage:
Sometimes the function proceeds even when ImageAttr is undefined.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

03 Sep 2019, 14:21

@jeeswg . Okay, thank you . I will check this.

I pushed a new update: v1.60. It adds 37 new GDI+ functions.
Spoiler
Link: https://github.com/marius-sucan/AHK-GDIp-Library-Compilation

More to come...

Best regards, Marius.
Last edited by robodesign on 10 Sep 2019, 13:59, edited 1 time in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
User avatar
boiler
Posts: 2914
Joined: 21 Dec 2014, 02:44

Re: GDI+ standard library 1.45 by tic

03 Sep 2019, 20:29

robodesign wrote:
21 Aug 2019, 08:04
If you guys know of other functions, threads related to GDI+ that should be included, please let me know .
Nice job pulling all of these together, Marius. I don't see Masterfocus' Gdip_ImageSearch in your compilation, so you might want to add that.
User avatar
jNizM
Posts: 2503
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: GDI+ standard library 1.45 by tic

04 Sep 2019, 01:25

Why is there still Ptr := A_PtrSize ? "UPtr" : "UInt" in nearly every function? There is no need for this.
Use for handles or pointers -> ptr(*) or uptr
[AHK] 1.1.30.03 x64 Unicode | [WIN] 10 Pro (Version 1903) x64 | [GitHub] Profile
Donations are appreciated if I could help you
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

04 Sep 2019, 02:37

jNizM wrote:
04 Sep 2019, 01:25
Why is there still Ptr := A_PtrSize ? "UPtr" : "UInt" in nearly every function? There is no need for this.
Use for handles or pointers -> ptr(*) or uptr
Yes, I'm aware of this. However it's a very daunting task to remove all those... I prefer working on adding additional support for gdip APIs.

I'll look into master's focus image search function. When I collected functions... I skipped over those that use machine code as none worked on my end.

Now I'm implementing new functions. Yesterday I implemented 37 new functions, and I have left about 250. I don't know if I'll go through all of them.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

04 Sep 2019, 13:58

Hello!

Finished implementing 36 new GDI+ functions:
Spoiler
Still more to come...

When I grow tired, I will create an additional section in the readme.md file with the list of functions and parameters, grouped by GDI+ classes.

Link: https://github.com/marius-sucan/AHK-GDIp-Library-Compilation .

Best regards, Marius.
Last edited by robodesign on 10 Sep 2019, 14:00, edited 2 times in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

05 Sep 2019, 14:17

As promised... 27 new GDI+ functions implemented:
Spoiler
More to come...

I want AHK users to enjoy a rich GDI+ APIs wrapper...

Best regards, Marius.
Last edited by robodesign on 10 Sep 2019, 14:01, edited 1 time in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

06 Sep 2019, 15:43

Today, I managed to implement only 14 new functions...
Spoiler
Still.... more planned.

Best regards, Marius.
Last edited by robodesign on 10 Sep 2019, 14:01, edited 1 time in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

07 Sep 2019, 14:20

Hello, guys!

12 new functions:
Spoiler
Is anyone interested in fonts and drawing texts through GDI+ ? Should I implement API functions related to this?

Best regards, Marius.
Last edited by robodesign on 10 Sep 2019, 14:02, edited 1 time in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

09 Sep 2019, 13:25

Hello, guys!

Added 17 new functions:
Spoiler
About 20 to 30 functions still to be added are planned. Mostly Text/Fonts related ones and perhaps a few related to ImageAttributes and others...

Link: https://github.com/marius-sucan/AHK-GDIp-Library-Compilation

I will also try to add new example(s) featuring some of the new capabilities.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

10 Sep 2019, 14:06

Hi, guys!

Another batch of new GDI+ functions implemented. This time 17 new functions.
Spoiler
Just a few functions left planned to implement related to fonts/text drawing. I will try to create a function to easily write texts vertically... After this, some ImageAttributes goodies. Then, kaputt. ;-).

Best regards, Marius.
Last edited by robodesign on 11 Sep 2019, 13:57, edited 2 times in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
iPhilip
Posts: 417
Joined: 02 Oct 2013, 12:21

Re: GDI+ standard library 1.45 by tic

10 Sep 2019, 14:31

Hi @robodesign

You might want to add the function below to your library. I found it useful in a couple of scripts.

Code: Select all

; DashStyleSolid = 0
; DashStyleDash = 1
; DashStyleDot = 2
; DashStyleDashDot = 3
; DashStyleDashDotDot = 4
; DashStyleCustom = 5
; https://technet.microsoft.com/pt-br/ms534104(v=vs.71).aspx

Gdip_SetPenDashStyle(pPen, DashStyle) {
   Return DllCall("Gdiplus.dll\GdipSetPenDashStyle", "Ptr", pPen, "Int", DashStyle)
}
Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

10 Sep 2019, 15:26

@iPhilip . Thank you . I will add it. If you have any other functions, please let me know . [this applies to anyone else]

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
malcev
Posts: 222
Joined: 12 Aug 2014, 12:37

Re: GDI+ standard library 1.45 by tic

10 Sep 2019, 19:21

I think here is error::

Code: Select all

Gdip_CreateBitmapFromClipboard() {
   Ptr := A_PtrSize ? "UPtr" : "UInt"
   if !DllCall("IsClipboardFormatAvailable", "uint", 8)
      return -2
   if !DllCall("OpenClipboard", Ptr, 0)
      return -1
   if !hBitmap := DllCall("GetClipboardData", "uint", 2, Ptr)
      return -3
   if !pBitmap := Gdip_CreateBitmapFromHBITMAP(hBitmap)
      return -4
   if !DllCall("CloseClipboard")
      return -5

   DeleteObject(hBitmap)
   return pBitmap
}
After open clipboard You always have to close it.
iPhilip
Posts: 417
Joined: 02 Oct 2013, 12:21

Re: GDI+ standard library 1.45 by tic

10 Sep 2019, 20:21

Hi @robodesign,

I noticed a possible error in your library.

Code: Select all

Gdip_CreateHICONFromBitmap(pBitmap) {
   pBitmap := ""  ; <--- I think this line should not be here
   hIcon := 0

   DllCall("gdiplus\GdipCreateHICONFromBitmap", A_PtrSize ? "UPtr" : "UInt", pBitmap, A_PtrSize ? "UPtr*" : "uint*", hIcon)
   return hIcon
}
Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

11 Sep 2019, 02:58

@iPhilip . True. It is an error inherited from mmikeww's GDI+ lib edition. I will have it fixed in the next update [today or tomorrow ]. Thanks very much for spotting the error.


@malcev . This bug is inherited from Tic's GDI+ library edition. I fixed it now. Thank you as well for spotting this.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 528
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: GDI+ standard library 1.45 by tic

11 Sep 2019, 13:53

Hi, again!

V1.68 is here with 10 new functions.
Spoiler
I also made fixes/changes based on the observations I got from Malcev and iPhilip. Thanks again. Please let me know if the changes to the clipboard function are satisfactory.

I am almost ready now to implement ImageAttributes related functions. This is the last area of GDI+ APIs I will focus on. The GDI+ GraphicsPathIterator and Metafile APIs represent no interest for me. These are the only two «major areas» entirely missing from this GDI+ library wrapper.

Link: https://github.com/marius-sucan/AHK-GDIp-Library-Compilation

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Bing [Bot], burque505, c600g, gwarble, JoeWinograd, robodesign and 63 guests