Determine if a point is inside or ouside of an irregular shape on a bitmap
If shape on bitmap is not filled and only one shape present on bitmap:
Start at point (x,y). For each of the four directions (left, right, top, bottom), keep going until either IsBitIsOn is true or a border of the bitmap has been reached. In the former case, point is in shape. Else (if border of bitmap reached), point is not in shape.
Pseudocode:
def IsInTheShape(x, y):
  curr_x = x
  curr_y = y
  # Check left
  while curr_x &gt;= -1:
    if (curr_x == -1):
      return false
    if IsBitIsOn(curr_x, y):
      break

  curr_x = x
  curr_y = y
  # Check right
  while curr_x &lt;= bitmap.width + 1:
    if (curr_x == bitmap.width + 1):
      return false
    if IsBitIsOn(curr_x, y):
      break

  # Check top
  # Check bottom

  # All directions hit IsBitIsOn, so must be in shape
  return true

If shape on bitmap is not filled and one or multiple shapes are present on bitmap:
Same as above, but once an outline has been reached, check all connected outline pieces recursively until the starting point has been reached. If the traversal around the outline visits all of the other outlines from the other three directions, then point is inside shape.
If shape on bitmap is filled:
Suppose that we want to check if (x,y) is in shape. Let (x,y) be cell E in the following grid:
+---+---+---+
| A | B | C |
+---+---+---+
| D | E | F |
+---+---+---+
| G | H | I |
+---+---+---+

Case 1 (point trivially not in shape):

Point is not in shape if E is off: if not IsBitIsOn(E): return false

Case 2 (point not in shape):

Point is not in shape if any of the 8 surrounding bits around E is off:

if not (IsBitIsOn(A) and IsBitIsOn(B) and IsBitIsOn(C) and IsBitIsOn(D) and IsBitIsOn(F) and IsBitIsOn(G) and IsBitIsOn(H) and IsBitIsOn(I)): return false

Case 3 (point in shape):

Point is all of the 8 surrounding bits around E is on:

else: return true

All together, the pseudocode is:
if not IsBitIsOn(E):
  return false
else if not (IsBitIsOn(A) and IsBitIsOn(B) and IsBitIsOn(C) and IsBitIsOn(D) and IsBitIsOn(F) and IsBitIsOn(G) and IsBitIsOn(H) and IsBitIsOn(I)):
  return false
else:
  return true