Page 10 of 19

Re: GDI+ standard library 1.45 by tic

Posted: 28 Apr 2017, 22:03
by jeeswg
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.

Re: GDI+ standard library 1.45 by tic

Posted: 03 May 2017, 14:42
by nnnik
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

Re: GDI+ standard library 1.45 by tic

Posted: 03 May 2017, 15:38
by guest3456
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..

Re: GDI+ standard library 1.45 by tic

Posted: 03 May 2017, 15:57
by Helgef
Nice nnnik.
nnnik wrote: indirectReference.ahk
Interesting.

Re: GDI+ standard library 1.45 by tic

Posted: 03 May 2017, 23:35
by nnnik
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.

Re: GDI+ standard library 1.45 by tic

Posted: 03 May 2017, 23:51
by tic
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.

Re: GDI+ standard library 1.45 by tic

Posted: 04 May 2017, 01:18
by nnnik
Well the original GDI+ is function oriented not object oriented. Is the new library OOP or just the old library with Object Syntax?

Re: GDI+ standard library 1.45 by tic

Posted: 05 May 2017, 16:38
by tic
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.

Re: GDI+ standard library 1.45 by tic

Posted: 10 May 2017, 17:01
by tic
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

Re: GDI+ standard library 1.45 by tic

Posted: 18 May 2017, 16:45
by tic
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

Re: GDI+ standard library 1.45 by tic

Posted: 23 May 2017, 12:59
by Learning one
I have them - see attachments :)

Re: GDI+ standard library 1.45 by tic

Posted: 23 May 2017, 18:10
by joedf
haha cool :3

Re: GDI+ standard library 1.45 by tic

Posted: 23 May 2017, 23:52
by tic
Awesome! You're a hero Learning one. Really didn't want to have to redraw those!

Re: GDI+ standard library 1.45 by tic

Posted: 12 Jun 2017, 08:21
by guest3456
@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

Re: GDI+ standard library 1.45 by tic

Posted: 21 Jun 2017, 03:25
by nnnik
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.

Re: GDI+ standard library 1.45 by tic

Posted: 21 Jun 2017, 14:09
by guest3456
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

Re: GDI+ standard library 1.45 by tic

Posted: 18 Aug 2017, 04:27
by Victoriyan
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.

Re: GDI+ standard library 1.45 by tic

Posted: 29 Aug 2017, 06:53
by BoBo
Another sample of what Gdip is able to do ... :thumbsup:
New Icons Generic and Costumized - by Zaelia

Re: GDI+ standard library 1.45 by tic

Posted: 22 Sep 2017, 11:21
by tidbit
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

Re: GDI+ standard library 1.45 by tic

Posted: 23 Oct 2017, 23:05
by dd900
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.