Re: creating a .bmp file

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx> wrote in message
news:2007111719362343658-NpOeStPeAdM@xxxxxxxxxxxxxxxxxx
On 2007-11-17 19:20:50 -0800, "colin" <colin.rowe1@xxxxxxxxxxxxxxxxxx>
said:
...
but it produces a .bmp file wich has 'BM' as first 2 bytes.

it stil produces the same weird output however,
but I did manage to debug my directly aproach
and the .bmp file looks fine.

the 2 files look nothing alike whatsoever in a hex viewer.

the colours are weird too, its actually a boring grey rock surface
texture,
but the weird one looks like a colourful tartan pattern.

Does the palette actually include any color? If the palette is a
general-purpose palette and you know that only the grey colors are
actually used, then it's possible you've some wrong pixel values that are
using the wrong colors in the palette. Alternatively, if the palette
itself is wrong, you could have the right pixel values and still get
colors instead of the grey shades you're expecting.

Also, did you display the bitmap before saving it? Did it look correct
then? Or was it already wrong at that point?

I never actually viewed the bmp file before saving,
at the momnent im just trying to get the file import
working, saving them all to disc and viewing them is
an easy way to see if theres any anomolies,
the boring images had about 15 greyscale values in the 256 color table,
the badly saved images had a full color table full of seemingly random
colours.

also the pixel tsble seemed to bear no relation whatsoever to the value
given to the constructor.

there are other images wich do have plenty of colour and these look pretty
much the same
weird tartan pattern, my direct aproach seems to display all these
beutifully however,
despite they are so dammed dark, but this seems to be a 'feature' of the
game they come from
(unreal), i might play around with the gamma of the color table.

the images will ultimatly be used as textures for a 3d surface.
but this is also an editor so a list will be displayed to be able to select
the desired pattern.

I dont know how the palette is so wrong as im putting in the right vallues
unless im just
getting a copy of the palette to wich my changes are just simply thrown
away.
wich is why i thought i couldnt change the palette in the first place.

but the bitmap data is so wrong too, maybe my pinned array isnt behaving as
I expect.
I use marshaleing elsewhere in the program and I suspect it is cuasing weird
problems,
although it does seem to do what its suposed to.
I may try and avoid unsafe totaly code if i can.

thanks
Colin =^.^=


.



Relevant Pages

  • [HISPASEC] FireFox 2.0.0.11 and Opera 9.50 beta Remote Memory Information Leak, FireFox 2.0.0.11 Rem
    ... The code allows to craft a BMP file that leaks ... the field says how many colors does the palette contain. ... FireFox 2.0.0.11 and prior that support canvas.getImageData or any ... FireFox 2.0.0.11 may crash when using this vulnerability due to ...
    (Bugtraq)
  • Re: creating a .bmp file
    ... ie i have 256 color pallete of RGBquads and array of 8bit pixels, ... but it doesnt seem to let me set the color palette, ... the Microsoft knowledge base includes this suggestion to create a dummy bitmap and grab the palette from that before disposing the dummy bitmap: ... And barring either of those methods working out for you, it's not like it's really all that difficult to write the BMP file from scratch, even if it is annoying. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: creating a .bmp file
    ... There's not much you could specify for a BMP file anyway; maybe CompressionRle would be useful, but otherwise BMP are pretty straight-forward. ... If the palette is a general-purpose palette and you know that only the grey colors are actually used, then it's possible you've some wrong pixel values that are using the wrong colors in the palette. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: creating a .bmp file
    ... to write to a .bmp file, ... but it doesnt seem to let me set the color palette, ... where one palette is shared by more than one pixel array. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: 8 bit values in mode 13h?
    ... what I meant by "modern cards", ... Well, despite being called 24-bit images, they never use all the ... instance, there's only 786,432 pixels...so even if all the pixels were ... palette so that it'll better represent what's there...also, ...
    (alt.lang.asm)