GDI+ standard library 1.45 by tic

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: GDI+ standard library 1.45 by tic

28 Apr 2017, 22:03

Perhaps this:

Code: Select all

Gdip_CreateBitmapFromClipboard()
{
	if !DllCall("OpenClipboard", Ptr, 0)
		return -1
	if !DllCall("IsClipboardFormatAvailable", "uint", 8)
		return -2
should be this:

Code: Select all

Gdip_CreateBitmapFromClipboard()
{
	if !DllCall("IsClipboardFormatAvailable", "uint", 8)
		return -2
	if !DllCall("OpenClipboard", Ptr, 0)
		return -1
A workaround is:

Code: Select all

pBitmap := Gdip_CreateBitmapFromClipboard()
if (pBitmap = -2)
	DllCall("CloseClipboard")
Otherwise you risk the clipboard being made unavailable, as happened to me. Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: GDI+ standard library 1.45 by tic

03 May 2017, 14:42

I am currently working on recreatig this API in OOP.
There are many reasons to do so. Microsoft basically made it to be wrapped around by objects.
So far I got: https://github.com/nnnik/classGDIp
Recommends AHK Studio
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: GDI+ standard library 1.45 by tic

03 May 2017, 15:38

nnnik wrote:I am currently working on recreatig this API in OOP.
There are many reasons to do so. Microsoft basically made it to be wrapped around by objects.
So far I got: https://github.com/nnnik/classGDIp
you realize that @tic was already working on that too? but i don't know how far he got:

https://github.com/tariqporter/Gdip/tree/GdipDOM

his is in a separate branch thats why you probably missed it..

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: GDI+ standard library 1.45 by tic

03 May 2017, 15:57

Nice nnnik.
nnnik wrote: indirectReference.ahk
Interesting.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: GDI+ standard library 1.45 by tic

03 May 2017, 23:35

guest3456 wrote:
nnnik wrote:I am currently working on recreatig this API in OOP.
There are many reasons to do so. Microsoft basically made it to be wrapped around by objects.
So far I got: https://github.com/nnnik/classGDIp
you realize that @tic was already working on that too? but i don't know how far he got:

https://github.com/tariqporter/Gdip/tree/GdipDOM

his is in a separate branch thats why you probably missed it..
No I didn't miss it. It's just an entirely different way of OOP and more than a simple wrapper. He tried to add a Canvas which I wouldn't add on that level.
Recommends AHK Studio
tic
Posts: 92
Joined: 03 Nov 2014, 03:10

Re: GDI+ standard library 1.45 by tic

03 May 2017, 23:51

If I remember correctly, the actual Gdip wrapper part was mostly done, but then the window drawing / updating part was where it stalled because it became too messy without anonymous functions.

I can take a look at it and perhaps just remove all the "DOM" stuff, and just have it the same as the original Gdip, but with OOP. It should be pretty much done.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: GDI+ standard library 1.45 by tic

04 May 2017, 01:18

Well the original GDI+ is function oriented not object oriented. Is the new library OOP or just the old library with Object Syntax?
Recommends AHK Studio
tic
Posts: 92
Joined: 03 Nov 2014, 03:10

Re: GDI+ standard library 1.45 by tic

05 May 2017, 16:38

nnnik wrote:Well the original GDI+ is function oriented not object oriented. Is the new library OOP or just the old library with Object Syntax?
You can see in the repository that it is object oriented. It keeps the original functions as wrappers if direct use is needed.
I have setup a simple webpack build system and will push within the next week.
tic
Posts: 92
Joined: 03 Nov 2014, 03:10

Re: GDI+ standard library 1.45 by tic

10 May 2017, 17:01

I have added the beginning of Gdip2:

https://github.com/tariqporter/Gdip2

I will go through and remove anything that isn't needed, and add any missing functions, and wrappers if needed, allowing access to flat functions as well.

I am building with webpack, and you can see that I have created an ahk-loader for merging .ahk files into one final file (Inside the dist folder), determined by the use of #Include

Edit:

I have added the first 3 examples in the new format
tic
Posts: 92
Joined: 03 Nov 2014, 03:10

Re: GDI+ standard library 1.45 by tic

18 May 2017, 16:45

Does anyone have these original images?

Code: Select all

	UrlDownloadToFile, http://www.autohotkey.net/~tic/mario.png, mario.png
	UrlDownloadToFile, http://www.autohotkey.net/~tic/link.png, link.png
User avatar
Learning one
Posts: 173
Joined: 04 Oct 2013, 13:59
Location: Croatia
Contact:

Re: GDI+ standard library 1.45 by tic

23 May 2017, 12:59

I have them - see attachments :)
Attachments
link.png
link.png (1.47 KiB) Viewed 7596 times
mario.png
mario.png (1.43 KiB) Viewed 7596 times
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: GDI+ standard library 1.45 by tic

23 May 2017, 18:10

haha cool :3
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
tic
Posts: 92
Joined: 03 Nov 2014, 03:10

Re: GDI+ standard library 1.45 by tic

23 May 2017, 23:52

Awesome! You're a hero Learning one. Really didn't want to have to redraw those!
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: GDI+ standard library 1.45 by tic

12 Jun 2017, 08:21

@buliasz has submitted changes to make this library compatiable with the new AHK v2 a079+ which introduce significant syntax changes

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

User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: GDI+ standard library 1.45 by tic

21 Jun 2017, 03:25

https://github.com/mmikeww/AHKv2-Gdip/issues/8
https://github.com/mmikeww/AHKv2-Gdip/pull/9
Edit: This is meant for the AHK v1 Version of the Script I dont know if the problem still persists in AHK v2.
Recommends AHK Studio
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: GDI+ standard library 1.45 by tic

21 Jun 2017, 14:09

nnnik wrote:https://github.com/mmikeww/AHKv2-Gdip/issues/8
https://github.com/mmikeww/AHKv2-Gdip/pull/9
Edit: This is meant for the AHK v1 Version of the Script I dont know if the problem still persists in AHK v2.
i accepted it, but i think it is redundant, because v2 is #NoEnv by default if i remember correctly.

the lib in my repo is no longer backwards compatible with AHK v1, since the latest v2 update has significantly changed the command syntax

https://autohotkey.com/v2/v2-changes.htm

Victoriyan
Posts: 5
Joined: 06 Aug 2017, 03:33

Re: GDI+ standard library 1.45 by tic

18 Aug 2017, 04:27

Hello.
I am interested in such a task. Is it possible to recognize images on images using autohotkey. I do not know much about autohotkey, but it's just interesting.

In this you something similar is discussed, but I can not understand specifically about what tasks are being discussed.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: GDI+ standard library 1.45 by tic

29 Aug 2017, 06:53

Another sample of what Gdip is able to do ... :thumbsup:
New Icons Generic and Costumized - by Zaelia
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Re: GDI+ standard library 1.45 by tic

22 Sep 2017, 11:21

tic wrote:beep
no offense tic, but can we remove your download link and only keep _All ?

yours is pretty old and clearly not maintained (neither is _all). but we (atleast on irc) get a lot of people who keep downloading your version, not the "alternative" version. Even if we tell them to get _all they still get yours.

Can you update your version to work with ALL ahk versions or replace it with Gdip_all? it'd save so many people so much hassle and time.

Thanks
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
dd900
Posts: 121
Joined: 27 Oct 2013, 16:03

Re: GDI+ standard library 1.45 by tic

23 Oct 2017, 23:05

Hey tic just got around to trying out Gdip2. I'm having a bit of trouble with example 3 (create-gui-from-image). If I try to set the x and y coords to anything but 0 the right and bottom sides of the image get cut off.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: chinagreenelvis, gongnl, MrDoge, TheNaviator and 80 guests