We report on the magnetic properties of elongated submicron magnetic islands and their influence on a superconducting film. The magnetic properties were studied by magnetization hysteresis loop measurements and scanning-force microscopy. In the as-grown state, the islands have a magnetic structure consisting of two antiparallel domains. This stable domain configuration has been directly visualized as a 2x2-checkerboard pattern by magnetic-force microscopy. In the remanent state, after magnetic saturation along the easy avis. all islands have a single-domain structure with the magnetic moment oriented along the magnetizing field direction. Periodic lattices of these Co islands act as efficient artificial pinning arrays for the nux lines in a superconducting Pb film deposited on top of the Co islands. The influence of the magnetic state of the dots on their pinning efficiency is investigated in these films, before and after the Co dots are magnetized.