In this paper, a novel lossy image compression scheme suitable for fast window query which is based on Hilbert curve and VQ is proposed. It allows us to perform window query directly on the compressed code of a gray-level image without decompressing the full compressed image first. The compression effect achieved by our method is also excellent. According to the substantial experimental results, the applicability of our method can be demonstrated.