Jump to content
  • Advertisement
Sign in to follow this  
gah_ribaldi

Manipulating bitmaps

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have the following code in place to load bitmaps into my program:
AUX_RGBImageRec *ConqOGL::LoadBMP(char *Filename)// Loads A Bitmap Image
{
	FILE *File=NULL;	// File Handle

	if (!Filename)		// Make Sure A Filename Was Given
	{
		return NULL;	// If Not Return NULL
	}

	File=fopen(Filename,"r");// Check To See If The File Exists

	if (File)		// Does The File Exist?
	{
		fclose(File);	// Close The Handle
		return auxDIBImageLoad(Filename);// Load The Bitmap And Return A Pointer
	}

	return NULL;		// If Load Failed Return NULL
}


And I am able to go on to bind this to a texture for use by my program. However, I do not know how to do two important things: 1) manipulate the bitmap, e.g. change individual pixels or blit another bitmap onto this one; and 2) save the manipulated bitmap to disk. Can anyone explain how to do these things, or point me in the direction of a good tutorial?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!