GDI+ workings

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
GraviaDaemonium
Posts: 7
Joined: 27 May 2023, 02:28
Contact:

GDI+ workings

Post by GraviaDaemonium » 28 May 2023, 10:02

I created a GDI+ class, but it won't draw on the bitmap. (I've used the tutorials and examples in https://github.com/buliasz/AHKv2-Gdip/blob/master/Examples/Gdip.Tutorial.2-Draw.Outlined.Shapes.ahk this github
And sadly ChatGPT wasn't helpful either :o

Here's a pastebin to my code (note, I've separated the Props class, and the Hunt class into their own respective files) <https://pastebin.com/eaMzy02q>
The thing is, the dropdown works, and the properties in the Props class are all being set just how I want them.
But what I am not managing is to create a bitmap (or graphics, that part is uncharted waters for me) that is the same size as the client portion of the window from `WinExists("Sklotopolis")` which should be 1000x1000 pixels.
And then start the drawing of the `Gdip_DrawPie()` method, where the point starts at the `this.props.X` and `this.props.Y` coordinates.

Currently the `MsgBox` states that it is drawing at the right coordinates, but I see not a single drawing on screen, which might be because it's drawing somewhere off screen? I really don't know, so I could use some help here.

If it isn't too much trouble, doing a voice chat could help a lot. But if chat is the extent of your help, I am happy to get that as well! At this point, I'm so deep in it that I'm starting to get a panic :(

User avatar
Smile_
Posts: 858
Joined: 03 May 2020, 00:51

Re: GDI+ workings

Post by Smile_ » 28 May 2023, 17:08

2 things may help you:
  • While you setup, use a pen instead of a brush
  • Update your layered window after each drawing

Post Reply

Return to “Ask for Help (v2)”