PDA

View Full Version : Using excel to read pixel color in .bmp files



piercedgeek
01-16-2007, 08:14 PM
If possible, I'd like to get excel to read the pixel color (RBG or hex) of various pixels from a .bmp file and write them out to a workbook.
I've spent a good amount of time searching but have yet to get anything working.:banghead:
Bitmap.GetPixel was the most promising thing I could find, but none of the code examples will work in excel, they seemed to be intended for just VB(not VBA)

Thank you,
Chris

Andy Pope
01-17-2007, 02:44 AM
Hi,

Have a look at these examples, not sure if Ivan's code is viewable though.
http://www.xcelfiles.com/ImageToXL.html
http://www.andypope.info/fun/bmpconvert.htm

piercedgeek
01-17-2007, 06:34 AM
Hi Andy,
I think the second will get me where I want to go. The code does much more than I need (draws an entire picture vs getting a few pixels) but I should have a strong enough understanding of VBA to pull out the parts that will work for me.

Based on your name, I'm going to guess it's yours? ;)
The code is clean and easy to understand, I wanted to thank you for that before I started toying with it.

This is a little side project of my own, and I need to head to work at the moment, I'll probably work on your code tonight or over the weekend, will post how things turn out.

Thanks again!

andysuth
06-30-2009, 07:06 AM
I know this post is long since abandoned, but I've used your code to solve my hex reader issue Andy, Thanks for sharing it.

I'm now just cutting out the parts I don't use and then I'll have to make an export function to put the processed data back into the BMP file.

Thanks,

-Andy.

Typegeek
05-13-2014, 12:25 PM
This is definitely an old post, and I noticed the site says that the examples serve no real purpose, but at the moment I have the idea of taking a Cartographer map used to determine the location of precious ores in Minecraft and use it to plot their location in Excel.

This is a great little example Andy!
-Rick