Hilton
Mon Feb 04 14:03:37 CST 2008
If the BMP is compressed, you need to handle that too. Do this using
streams; i.e. open the BMPStream using another stream (or filename). This
BMPStream would have calls like "Color NextPixel", SkipPixels (int n), and
"MoveToNextRow" etc; i.e. the code reading this stream should not care about
how the BMP is compressed. If it made sense, you could add SkipRow(), you
don't need SkipPixel since you could just call NextPixel and ignore what it
returns. However, getting back to what you originally asked, you need to
think about the new Bitmap (filename, x, y, cx, cy) call. If you can solve
that, you're pretty much done.
Hope that makes sense.
Hilton
"<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote in message
news:uEC38P2ZIHA.748@TK2MSFTNGP04.phx.gbl...
> You have to use Seek on the source stream and manually calculate the
> offsets based on the image properties (bits per pixel, stride, etc).
>
>
> --
>
> Chris Tacke, eMVP
> Join the Embedded Developer Community
>
http://community.opennetcf.com
>
>
>
> "Broeden" <hihansson@hotmail.com> wrote in message
> news:27e398a7-321b-4602-ab78-b2db45baa8ba@s13g2000prd.googlegroups.com...
>> Thanks Hilton for your reply!
>>
>> I found some articles on how to manipulate bitmaps on the Net to start
>> with.
>>
>> What I'm now looking for is an example of how to select parts of the
>> stream.
>>
>> For instance how could SkipEverySecondPixel be implemented?
>>
>> Stream stream = new Stream("test.bmp");
>> Stream newStream = SkipEverySecondPixel(Stream);
>> bmp = new Bitmap(NewStream );
>> stream.Close();
>> newStream.Close();
>>
>> /Broeden
>>
>
>