Re: creating a .bmp file
- From: "colin" <colin.rowe1@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 18 Nov 2007 04:10:03 GMT
"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 =^.^=
.
- References:
- creating a .bmp file
- From: colin
- Re: creating a .bmp file
- From: Peter Duniho
- Re: creating a .bmp file
- From: colin
- Re: creating a .bmp file
- From: Peter Duniho
- Re: creating a .bmp file
- From: colin
- Re: creating a .bmp file
- From: colin
- Re: creating a .bmp file
- From: Peter Duniho
- Re: creating a .bmp file
- From: colin
- Re: creating a .bmp file
- From: Peter Duniho
- creating a .bmp file
- Prev by Date: Re: creating a .bmp file
- Next by Date: Re: C# Equivalent to VB's Weekday function
- Previous by thread: Re: creating a .bmp file
- Next by thread: Re: creating a .bmp file
- Index(es):
Relevant Pages
|