bitmap_image
Entity: function

Usage:
Bitmap is bitmap_image(Source, _)
Bitmap is bitmap_image(Source, Mask)

Creates a bitmap object from the file Source with mask file Mask. You can use later this bitmap object with the predicate draw_bitmap to draw this bitmap somewhere.

The purpose of the Mask is to make bitmap object with a transparent color in it. If you do not need transparent color in your bitmap then ignore this parameter (put _ (underline) on its place).

How to make transparent color? In your bitmap replace the color which should to be transparent with black. You have to make also a Mask bitmap. The Mask bitmap is the same but in black and white. In it the transparent color is white and all other colors are black.

How the transparent color works? First is made a logical AND between the screen and the Mask bitmap. The result is a black hole on the place where are not transparent colors (i.e. where the Mask is black). The transparent part of the image stays untouched. The second step is to make logical OR between the screen and the Source bitmap. As a result the transparent part is untouched again because it is added with Black and in the black hole appears the desired image (i.e Black OR color is equal to the same color).
 

Source     the full path of the bitmap file
Mask        the full path of the mask file
 

Examples:
?-
...
  Bitmap is bitmap_image("image.bmp", _),
  draw_bitmap( 10, 10, Bitmap, _, _).