This invented P-Zn1-xMgxO crystal film is one doped by one or several in B, Al, Ga and In as the donor and one or several of N, P, AS gases as the acceptor, the molar content of X is larger than 0 smaller than 40%, and the doped density is 1015~1019cm[-3]. The film is prepared by pulse laser deposition, the target is a ceramic one sintered with pure ZnO, MgO and donor doping agent powder, among which, the molar content of MgO is larger than 0 but smaller than 40%, that of the donor doping agent is larger than 0 but smaller than 3%, the grown temperature is 400~700deg.C, the grown atmosphere is a mixed gas containing the acceptor activated by plasma and pure O2, the doped density can be controlled by adjusting different intrinsic stand-off ratios of the input gas with acceptor and O2 and molar content of the donor doping agents in the target material and the successive annealing temperature.