![]() |
|
How to copy a bitmap? |
boulifb
Member #7,281
May 2006
|
Hello guys, I'd like to know how can I clone a bitmap that has been programmatically created?
How should I write the "CloneBitmap" function I have seen nothing in the doc to do a bitmap copy... Thanks for helping me. Best regards. Fred. |
gnolam
Member #2,030
March 2002
![]() |
A bitmap copy is also known as a blit... -- |
Onewing
Member #6,152
August 2005
![]() |
manual said: The origin of the term "blit" is also rather interesting. This was originally BitBlt, an abbreviation of BITmap BLock Transfer, which was a function designed (possibly) by the people at Xerox who did so much of the pioneering work on graphics display systems, and subsequently copied by virtually everybody doing computer graphics (the Microsoft Windows GDI still provides a BitBlt function with identical functionality to the original). This routine was a workhorse for all sorts of drawing operations, basically copying bitmap graphics from one place to another, but including a number of different ROP modes (Raster OPerations) for doing things like XOR, inverting pixels, etc. A whole family of related words grew up around the BitBlt function, but "blt" is impossible to speak (try saying "bltter" or "bltting" :-) so people added the vowel to make it easier to pronounce. Emphasis mine. ------------ |
CursedTyrant
Member #7,080
April 2006
![]() |
My best shot would be: 1. Create a BITMAP. Maybe: BITMAP *CloneBitmap(BITMAP *BMP) { BITMAP *Tmp = create_bitmap(BMP->width, BMP->height); blit(BMP, Tmp, 0, 0, 0, 0, BMP->width, BMP->height); return Tmp; } Now I might be wrong with the width and height, I can't remember their names, but I think the example should work. --------- |
Matthew Leverton
Supreme Loser
January 1999
![]() |
It is w and h. |
boulifb
Member #7,281
May 2006
|
ah yes, blitting.... why should have not thought about it before... many thanks Fred. |
|