www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/12/09:38:01

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE35274B7@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Help: Converting 24bit bitmap to seperate R,G,B files using A
llegro?
Date: Fri, 12 Feb 1999 14:36:20 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

Dave Nugent writes:
> I want to be able to take a 24 bit color bitmap, and create
> 3 seperate files from it, 1 for Red, Green and Blue.

Read in your source in 24 bit format (set_color_depth(24), 
set_color_conversion(COLORCONV_TOTAL), then load it in as usual).
Use getpixel() to read pixels from the source graphic, getr24(), 
getg24() and getb24() to split that value up into individual
color components, create_bitmap_ex() to construct three eight bit
output images, putpixel() to write your r/g/b values to these
images, and save_bitmap() to save out the results.


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019