I'm trying to use the user's profile image -- which for testing is my own (custom) profile image. I remember setting it up -- I supplied a straight-forward png (or bmp, I can't remember which now) to the system and it generated a .bmp file:
C:\Users\Michael\AppData\Local\Temp\Michael.bmp
(just where it should be)
Only, my attempts to load it with software produce an image that is offset wildly. I've used three different software packages to try to load this thing now, and it still comes out shifted.
Irfanview and GIMP have no problem opening the file correctly.
Which means that I'm probably going to have to write something that's going to manually load the image myself. (Fooey!)
So my question is...
why is this so? Does the system create bad profile "tile" images?
[edit] And what does Irfanview/GIMP do to recognize and fix the error? [/edit]
Because this is really putting a damper on doing something that should be simple and pretty...
In Windows 7 the profile 'pictures' are stored in .dat files in C:\Users\All Users\Microsoft\User Account Pictures\
Edit...
A bmp is generated in AppData\Local\Temp and looks like a normal BMP, can be opened in preview.
If I delete the .bmp it seems to stay deleted until I go back to user accounts to change the picture, then it was recreated. I don't think the system uses the file from temp for 'normal' use.
If I get a bit of time (not on a Windows PC just now) I'll take a look to the .bmp, or if you can post the values of the first 20 bytes I'll see if I can tell you what format it is...
...looking at it now...
...it's a standard Windows 24bit no compression 128 by 128 bitmap, nothing special.
I'm not at my PC ATM, but if I remember correctly,
Standard Delphi TImage (D5)
Graphics32.org
I don't remember the name of the other bitmap loader I had lying around. It belonged to some random component set.
Now that I'm explaining this to you, it could easily be that the (antiquated) D5 image loader is the only one being used... and that it is failing...
I still have to look at the BMP itself too.
/me feels stupid
Though, to be fair, I did test the components against a couple of BMP test suites before posting... with no problems. The only BMP I have that causes the problem is my user tile.
I tried displaying my profile picture using SFML and it is displaying several of the leftmost columns of pixels on the right of the image. But using this winapi code I found (I'm not a winapi guy) displays it corectly.
That's the problem I'm having with mine -- it is offset wrong. What it looks like (and I haven't actually looked at the file yet) is that the offset to the image data is incorrect, so that the image begins displaying some number of bytes into the first raster, causing the offset. Since the image width is a multiple of four, it works out without any garbage between rasters.