• Become a Power user Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Painlessly switch from V1 to V2

Search Results for: hellbent

Hellbent and Isaias solving Cursor / Bitmap issue with GDI in v2

Solving cursor and bitmap issues in GDI for AutoHotkey v2

Solving cursor and bitmap issues in GDI for AutoHotkey v2

The video discusses using GDI to solve bitmap and picture control issues, including capturing and pasting images with the cursor, and explores different methods for creating and saving bitmaps in C++ and Python.

  • 00:00 👨‍💻 Isaias and Hellbent worked on bitmap and picture control issues, creating a new screenshot class with cursor capture function using GDI.
    • Isaias and Hellbent worked through bitmap and picture control issues in the GDI library, sharing deep learning experiences.
    • Created a new class called screenshot in hotkey V2 that can take screenshots from screen, activity window, and client, with a function called capture, which had an issue with reading information in the wrong order but was eventually resolved.
    • The speaker captures the cursor using GDI and fills out a specific structure with information about the cursor’s size, flags, position, and type.
    • The function gets the icon, reads values from the cursor, draws it using GDI, and returns the context for that particular cursor.
  • 04:30 📋 When working with GDI, manually releasing objects and copying memory prior to setting up the clipboard can solve issues with capturing and pasting images, including the I-beam cursor.
    • When working with GDI, objects must be released manually, and creating a new bitmap can cause issues when trying to copy it to the clipboard.
    • The speaker explains a function that captures cursor information and saves it properly into the clipboard, but when using an I-beam cursor, the captured image appears as a blank square.
    • The I-beam cursor changes color depending on the background and may not actually be an I-beam, with the bit mask and color playing a potential role in its appearance.
    • Copying memory prior to setting up the clipboard may solve issues with the H Global memory handle.
    • Is there a GDI function to convert H Global to H bitmap for use in a picture control?
    • The speaker demonstrated how to copy an image to the clipboard and paste it into a program using the “get image” function.
  • 13:37 📚 Use GDI plus underscore create bitmap from clipboard to easily copy and retrieve images for quick prototyping in the library.
    • The solution is to take the internet into the library.
    • The speaker found a function called GDI plus underscore create bitmap from clipboard that allows for copying images from the clipboard to the screen.
    • Quickly prototype by using a simple two-line code to transfer clipboard data into a bitmap or h-bitmap for testing.
    • The speaker explains how to copy an image to the clipboard and retrieve it using a static function in a class method.
  • 20:00 🔍 Knowing the difference between calling static and instance methods is important in V1 and V2.
    • The speaker discusses the difference between calling static and instance methods in V1 and V2, and the importance of knowing which one to call.
    • The speaker encountered a problem with the clipboard data and pointer allocation while trying to access a screenshot image class.
    • The speaker debugs an issue with a clipboard function by opening the clipboard before trying to get information out of it.
    • The issue with displaying data is not the data itself, but rather the control used to display it, specifically the use of GDI.
  • 26:18 📋 The speaker discusses saving a bitmap to a file and converting a pointer to a bitmap using “convert HP” function.
    • Copying an image to the clipboard requires an additional step of saving it to a file and then reading the file.
    • The speaker plans to save a bitmap to a file but is unsure if it will solve the problem they are currently facing.
    • The speaker discusses converting a pointer to a bitmap using a function called “convert HP” and notes that taking a screenshot already sets the H bitmap.
    • Create a bitmap and save it to a file using the pivot map.
  • 31:54 💻 Updating libraries and code is crucial for project success, while exploring different methods to create and save bitmaps in a file.
    • Always use Unicode and include the GDI plus library for testing, as there is no library for read.
    • The speaker is discussing the use of a codec to decode a string and obtain encoder parameters.
    • The speaker suggests the need for a visual confirmation when saving files and encounters an issue with the control function.
    • The speaker explores different methods to create and save bitmaps in a file.
    • The speaker discusses issues with outdated libraries and code in a project, and mentions the need to update to a newer version.
  • 40:09 👨‍💻 The speaker discusses file creation, pointer usage, and image saving in C++ and Python, encountering issues with if statements and file verification.
    • The speaker discusses creating a file and using a pointer in a function.
    • The code saves a bitmap to an H file and creates a BMP file using GDI library.
    • The speaker encountered an issue with an if statement, made some adjustments, and successfully wrote to a file, but had to specify the type of number every time, and still needed to verify if the file had the correct icon.
    • The speaker demonstrates how to locally load and save an image file in Python using the show function.
    • Using alt submit and GDI plus library allows for proper rendering of binary data in picture controls.
    • Data can be stored in a rock using ones and zeros.
  • 50:24 📷 Using GDI+ Library’s set image function can improve the quality of PNG images in a picture control, but there may be bugs with submitting images on a handle.
    • PNG images have transparency and opacity represented by zeros and ones, and GDI plus is required to work with newer image formats like PNG, which creates composite images with transparency.
    • The speaker discusses the issue of loading PNG images in a picture control and how specifying the image type as PNG does not work with a handle, but using the GDI+ Library’s set image function can improve the quality of the image.
    • The speaker encountered issues with a control’s size and loading a bitmap using GDI plus, but found that it worked correctly when using a BMP file and the “alt submit” command.
    • The rendering function doesn’t know how to handle transparency bits, resulting in different values when viewing an image in different ways.
    • The speaker discusses their process of creating a function to take screenshots from different sources and mentions the potential for using it in a Window Snipping Tool.
    • The issue of submitting images on a handle is complex and there may be a bug with the old submit that needs to be addressed.

How to use HellBent Button theme creator class to create multiple buttons

HellBent asked if I’d join him for  a video where we walk through his “button maker”.   This tool is really awesome!  While it does have the ability to save a created image as a PNG, that’s not it’s goal.  In my opinion the tool is better described as a “Button theme creator”.  You can use his GUI editor tool to create a “template” for images.   Then re-use your look (or borrow someone else’s) and “draw” your buttons.    You see, when you use this class, instead of saving images of buttons, you’re actually drawing the buttons on the screen.  You can get the files I created from the tutorial here.  The AutoHotkey Forum link to all the files is here

Drawing your buttons instead of using files, has several advantages

  1. It’s badass cool!
  2. You don’t have to worry about how your screen displays the images (stretching them for resolutions ,etc.)
  3. You don’t have to save the image files (which helps a lot when sharing your scripts)
  4. It’s much easier to deal with DPI issues (we cover this at the end of the video)

Walkthrough of HellBent Button theme creator class