Guest Posted September 18, 2012 Share Posted September 18, 2012 (edited) I want to open a png file and read the color of a particular pixel.I found that someone wrote this for bmp files: ; #FUNCTION# ====================================================================================================================; Name...........: _PixelRead; Description ...: Returns the color at the pixel coordinate and BMPHandle given.; Syntax.........: _PixelRead($BMPHandle,$X,$Y); Parameters ....: $BMPHandle - ""; $X - X coordinate of the pixel ; $Y - ""; Return values .: Success - A Color as a hex string in RRGGBB format; #FUNCTION# ====================================================================================================================Func _PixelRead(ByRef $BMPHandle,$x,$y)But I prefer to work on a png or jpg.. Edited September 18, 2012 by Guest Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 18, 2012 Moderators Share Posted September 18, 2012 Why not use PixelGetColor? That will work on a png. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Guest Posted September 18, 2012 Share Posted September 18, 2012 How exactly? I do not know how to use it for png Link to comment Share on other sites More sharing options...
iCode Posted September 18, 2012 Share Posted September 18, 2012 what logan is suggesting i think is to forget about the file type. PixelGetColor() works with anything - the png has been opened and is visible on the desktop, so PixelGetColor() will work. look at the example code also see PixelCoordMode() under AutoItSetOption if you're wanting to get the color based on mouse position, see MouseGetPos() FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
Yashied Posted September 19, 2012 Share Posted September 19, 2012 _GDIPlus_BitmapCreateFromFile() + _GDIPlus_BitmapGetPixel() from My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now