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 costs of the proceedings, or for such purposes as may be directed by the court.