We performed magnetic imaging of Ni-based ferromagnetic shape memory alloys. The magnetic microstructure was revealed by Lorentz microscopy and electron holography, which are powerful tools based on transmission electron microscopy. Observations of Ni51Fe22Ga27 and Ni50Mn25Al12.5Ga12.5 alloys, both of which have an L21-ordered structure in the parent phase, demonstrated that the antiphase boundaries (i.e., a type of planer defects) caused significant changes in the magnetization distribution due to depression of the atomic order—actually, the magnetization in these alloys depends upon the degree of chemical order. We propose a method which estimates the important magnetic parameters (the magnetocrystalline anisotropy constant and exchange stiffness constant) based on transmission electron microscopy observations. This method should be useful in magnetic measurements of nanometer-scale areas, for which conventional techniques cannot be applied.