Profile Tile bitmap is damaged?

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...
Last edited on
What profile/software are you referring to? Can you give an example?
closed account (z05DSL3A)
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.
Last edited on
Alas, I already know much of this. Profile pictures are only regenerated under specific conditions -- all involving the 'User Accounts' Control Panel Applet.
http://www.google.com/search?btnI=1&q=msdn+about+user+profiles

I'm just curious about the image itself. It seems to be (mal-?) formed in some way that all my software cannot handle.

Does anyone know why?
Or what is really going on?
closed account (z05DSL3A)
Duoas, sorry I think I misunderstood your post.

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.
Last edited on
closed account (z05DSL3A)
Duoas wrote:
I've used three different software packages to try to load this thing now, and it still comes out shifted.
What packages have you used?
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <windows.h>
#include <tchar.h>

int main()
{
    HDC hdc = CreateCompatibleDC(NULL);
    HBITMAP img = (HBITMAP) LoadImage(NULL, _T("C:/Users/Sean/AppData/Local/Temp/Sean.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
    SelectObject(hdc, img);
    while (1)
    {
        HDC hdc2 = GetDC(HWND_DESKTOP);
        BitBlt(hdc2, 600, 500, 126, 126, hdc, 0, 0, SRCCOPY);
        ReleaseDC(HWND_DESKTOP, hdc2);
    }

    return 0;
}
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.
Topic archived. No new replies allowed.