All I wanted was to be able to load an image, preferably from the clipboard, which apparently I also got working and then read and alter the pixels. That's it. Obviously, later on I'd like to save the data or something, but that's really not important at this point.
So, I searched the net and learned terms like HBITMAP, CF_BITMAP, CF:DIB, BITMAPINFO, BITMAPINFOHEADER, RGBWUAD, GetDIBits, etc...
But not once have I found anything which takes this back to basic and explains it from the beginning.
I mean, sure I got a HBITMAP with some data in it and if I use CF_DIB I can even read some data treating the variable like a simple array, but the data representation isn't as expected and it's probably not the right way to do things anyway.
Bottom line. this all seemed so simple to begin with, but apparently I was mistaken.
Now, I know someone will ask for some code so, though it really doesn't help anyone, here's some:
Code: Select all
#include <windows.h>
int main(int argc, char *argv[]) {
// grabs image from clipboard, if any
HBITMAP b;
if(OpenClipboard(NULL) && IsClipboardFormatAvailable(CF_DIB)) {
b = GetClipboardData(CF_DIB);
CloseClipboard();
return 0;
}
So if you know this subject, please try to guide me through it.
As I wrote earlier, all I need is to:
1. Load imagedata.
2. Manipulate the data
(and eventually)
3. save data.
Actually, since 1. is already done with, it seems, and 3. will be easy enough given easily accessible data, I really only need help with 2.
Anyway, I know I've been kind of a bother in the past and I fully understand if this is too much, but then maybe a link to the proper tutorial, which I haven't been able to find in 3 days of intensive searching...
Thanks in advance.