A court imposing any fine under this Act may direct that the whole or any part thereof shall be applied in, or towards payment of, the cost of the proceedings.