Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bitmap Manipulation

69 views
Skip to first unread message

Inevitability

unread,
Feb 20, 2003, 1:48:23 AM2/20/03
to
I'm sort of a novice when it comes to programming, I just know the
very basics, but I need some code that can take a bitmap and then just
output it as a stream of numbers representing the pixel colors, for
example "255240200" as the first pixel.

I've looked around on various sites like http://www.wotsit.org/ which
had all sorts of great info on various formats and stuff but none of
it really helped me out directly.

If it's really simple I'd be very grateful if someone could just write
the code for me, or if you could point me to some online tutorials on
bitmap manipulation in C++ that'd also be good.

I did find various references on loading bitmaps in C++ and what not
but no references with how you can manipulate the bitmap once loaded
nor how to convert it in the way I'm trying to.

-Inevitability
--

Mad Hatter©
"Will you, won't you? Will you, won't you? Won't you join the dance?"
mhm ¹ x ¹

Fuck The Norm!
http://webpages.charter.net/mad_hatter/AHM.html

Come Visit The Official Mad Hatter Chat Room!
irc.asylum.net -=- #Wonderland

Mike Wahler

unread,
Feb 20, 2003, 2:13:39 AM2/20/03
to

<Inevitability> wrote in message
news:46u85vcu6ug93ho49uh14oqv5t580m6ikb@farfoos...

> I'm sort of a novice when it comes to programming, I just know the
> very basics, but I need some code that can take a bitmap and then just
> output it as a stream of numbers representing the pixel colors, for
> example "255240200" as the first pixel.
>
> I've looked around on various sites like http://www.wotsit.org/ which
> had all sorts of great info on various formats and stuff but none of
> it really helped me out directly.
>
> If it's really simple I'd be very grateful if someone could just write
> the code for me, or if you could point me to some online tutorials on
> bitmap manipulation in C++ that'd also be good.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps
_99ir.asp

news:comp.os.ms-windows.programmer.win32

http://snurse-l.org/acllc-c++/faq.html

www.usenet.org

-Mike


Inevitability

unread,
Feb 20, 2003, 2:57:14 AM2/20/03
to
On Wed, 19 Feb 2003 23:13:39 -0800, "Mike Wahler"
<mkwa...@mkwahler.net> wrote:

>
><Inevitability> wrote in message
>news:46u85vcu6ug93ho49uh14oqv5t580m6ikb@farfoos...
>> I'm sort of a novice when it comes to programming, I just know the
>> very basics, but I need some code that can take a bitmap and then just
>> output it as a stream of numbers representing the pixel colors, for
>> example "255240200" as the first pixel.
>>
>> I've looked around on various sites like http://www.wotsit.org/ which
>> had all sorts of great info on various formats and stuff but none of
>> it really helped me out directly.
>>
>> If it's really simple I'd be very grateful if someone could just write
>> the code for me, or if you could point me to some online tutorials on
>> bitmap manipulation in C++ that'd also be good.
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps
>_99ir.asp

I'm thinkin the GetDIBColorTable function is what I need.
*sigh*
Gosh I hate programming. I have an extremely nifty idea for a video
compression codec and it works out on paper flawlessly, but bringing
the concepts over into practical application is turning out to be
nothing short of a little bastard.

Scott Campbell

unread,
Feb 23, 2003, 9:25:57 PM2/23/03
to
I believe the GetDIBBits function could help you out...


<Inevitability> wrote in message
news:sb295v08jihhnem7anbunib7k94d0avfdd@farfoos...

> Mad Hatterฉ


> "Will you, won't you? Will you, won't you? Won't you join the dance?"

> mhm น x น

White Wolf

unread,
Feb 23, 2003, 11:00:39 PM2/23/03
to
"Scott Campbell" wrote:
> I believe the GetDIBBits function could help you out...

And I believe it is time to killfile the off-topic thread...

WW


Inevitability

unread,
Feb 26, 2003, 3:25:47 AM2/26/03
to
On Mon, 24 Feb 2003 06:00:39 +0200, "White Wolf" <wo...@freemail.hu>
wrote:

>"Scott Campbell" wrote:
>> I believe the GetDIBBits function could help you out...
>
>And I believe it is time to killfile the off-topic thread...

I'm off topic? *snicker* I could SHOW you off topic. ^_^

-Inevitability

Mike Wahler

unread,
Feb 27, 2003, 2:03:37 AM2/27/03
to

<Inevitability> wrote in message
news:deuo5vo763kpjmmjjgvjps1rfarotctiij@farfoos...

> On Mon, 24 Feb 2003 06:00:39 +0200, "White Wolf" <wo...@freemail.hu>
> wrote:
>
> >"Scott Campbell" wrote:
> >> I believe the GetDIBBits function could help you out...
> >
> >And I believe it is time to killfile the off-topic thread...
>
> I'm off topic?

Your advice about a Windows API function is off-topic.

> *snicker* I could SHOW you off topic. ^_^

You already did.

-Mike

Inevitability

unread,
Mar 3, 2003, 12:28:17 AM3/3/03
to
On Wed, 26 Feb 2003 23:03:37 -0800, "Mike Wahler"
<mkwa...@mkwahler.net> wrote:

>> >> I believe the GetDIBBits function could help you out...

>> >And I believe it is time to killfile the off-topic thread...

>> I'm off topic?

>Your advice about a Windows API function is off-topic.

Hey *I* wasn't the one who gave out the Windows API advice. I asked
how to do it in C++, not my fault if that's all the better you
"experts" could come up with.

>> *snicker* I could SHOW you off topic. ^_^

>You already did.

Your naivety is astounding...maybe I'll break you... `, )

-Inevitability
--

Mad Hatter©


"Will you, won't you? Will you, won't you? Won't you join the dance?"

mhm ¹ x ¹

Mike Wahler

unread,
Mar 3, 2003, 1:39:07 AM3/3/03
to
<Inevitability> wrote in message
news:qqp56v06so9pqas11plpjoiooic3tij6hc@farfoos...

> On Wed, 26 Feb 2003 23:03:37 -0800, "Mike Wahler"
> <mkwa...@mkwahler.net> wrote:
>
> >> >> I believe the GetDIBBits function could help you out...
>
> >> >And I believe it is time to killfile the off-topic thread...
>
> >> I'm off topic?
>
> >Your advice about a Windows API function is off-topic.
>
> Hey *I* wasn't the one who gave out the Windows API advice.

My apologies. I got the attributions mixed up.


>I asked
> how to do it in C++, not my fault if that's all the better you
> "experts" could come up with.

The first part of this thread has expired from my server,
so I don't see the original query.

If you're wanting to manipulate a bitmap file (MS Windows
BMP or DIB file?) in memory or in files, but not do any display,
I'm sure it can be done with C++, given sufficient file format
documentation (did you check MSDN and perhaps wotsit.org?


> >> *snicker* I could SHOW you off topic. ^_^
>
> >You already did.
>
> Your naivety is astounding...maybe I'll break you... `, )

I don't think I'm naieve. I made a mistake with attributions.
I'm acknowledging that, and apologizing for it. Does commission
of a simple error make me naieve?

-Mike

Inevitability

unread,
Mar 3, 2003, 2:58:35 AM3/3/03
to
On Sun, 2 Mar 2003 22:39:07 -0800, "Mike Wahler"
<mkwa...@mkwahler.net> wrote:

><Inevitability> wrote in message
>news:qqp56v06so9pqas11plpjoiooic3tij6hc@farfoos...
>> On Wed, 26 Feb 2003 23:03:37 -0800, "Mike Wahler"
>> <mkwa...@mkwahler.net> wrote:
>>
>> >> >> I believe the GetDIBBits function could help you out...
>>
>> >> >And I believe it is time to killfile the off-topic thread...
>>
>> >> I'm off topic?
>>
>> >Your advice about a Windows API function is off-topic.
>>
>> Hey *I* wasn't the one who gave out the Windows API advice.
>
>My apologies. I got the attributions mixed up.
>
>
>>I asked
>> how to do it in C++, not my fault if that's all the better you
>> "experts" could come up with.
>
>The first part of this thread has expired from my server,
>so I don't see the original query.
>
>If you're wanting to manipulate a bitmap file (MS Windows
>BMP or DIB file?) in memory or in files, but not do any display,
>I'm sure it can be done with C++, given sufficient file format
>documentation (did you check MSDN and perhaps wotsit.org?

I just wanna take each pixels RGB value and stick the numbers into an
array. I checked out a few sites, but the closest thing I found was
this guy who wanted to make it show the RGB value when he moved the
mouse over a color, but I wasn't able to rework the code to do what I
had in mind.

>> >> *snicker* I could SHOW you off topic. ^_^

>> >You already did.

>> Your naivety is astounding...maybe I'll break you... `, )

>I don't think I'm naieve. I made a mistake with attributions.
>I'm acknowledging that, and apologizing for it. Does commission
>of a simple error make me naieve?

My point was that if it had been my intention to be off topic...I'd be
dominating over 90% of the traffic in this froup and everything would
be in chaos...I can have that effect on things sometimes. ^_^

Attila Feher

unread,
Mar 3, 2003, 3:00:43 AM3/3/03
to
Inevitability wrote:
> On Wed, 26 Feb 2003 23:03:37 -0800, "Mike Wahler"
> <mkwa...@mkwahler.net> wrote:
>
>>>>> I believe the GetDIBBits function could help you out...
>
>>>> And I believe it is time to killfile the off-topic thread...
>
>>> I'm off topic?
>
>> Your advice about a Windows API function is off-topic.
>
> Hey *I* wasn't the one who gave out the Windows API advice. I asked
> how to do it in C++, not my fault if that's all the better you
> "experts" could come up with.
>
>>> *snicker* I could SHOW you off topic. ^_^
>
>> You already did.
>
> Your naivety is astounding...maybe I'll break you... `, )
>
> -Inevitability

*PLONK*


Mike Wahler

unread,
Mar 3, 2003, 3:08:01 PM3/3/03
to
<Inevitability> wrote in message
news:ub266vot2uce7h4h3uhrk471ndb24flsoc@farfoos...

> >If you're wanting to manipulate a bitmap file (MS Windows
> >BMP or DIB file?) in memory or in files, but not do any display,
> >I'm sure it can be done with C++, given sufficient file format
> >documentation (did you check MSDN and perhaps wotsit.org?
>
> I just wanna take each pixels RGB value and stick the numbers into an
> array. I checked out a few sites, but the closest thing I found was
> this guy who wanted to make it show the RGB value when he moved the
> mouse over a color, but I wasn't able to rework the code to do what I
> had in mind.

I don't think looking for existing code is the way to go. Why not just
acquire
the file format description and go from there? Doesn't seem as
if it would be very difficult -- simple binary file i/o.

-Mike

0 new messages