Jump to content

Read .png file and get pixel color


Recommended Posts

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WinAPIGdi.au3>
#include <WindowsConstants.au3>

_GDIPlus_Startup()
$g_hImage = _GDIPlus_ImageLoadFromFile("output.png")
$bmp = _GDIPlus_BitmapCreateFromHBITMAP($g_hImage)

$color = _GDIPlus_BitmapGetPixel($bmp, 776, 679)
ConsoleWrite("Color at 776, 679 is "&hex($color)&@CRLF)
_GDIPlus_Shutdown()

I got

Color at 776, 679 is 00000000
 

When I am using example to read .png and draw it on gui pixel color is


>>>> Mouse <<<<
Position:    776, 679
Cursor ID:    0
Color:    0x147A9C


What I am doing wrong?

Link to comment
Share on other sites

On the getpixel function I get @error 10 and @extended 2, just no idea what they are.

On the bitmapcreate function I get @error 10 and @extended 7, just no idea what they are.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...