Apps Display Modification in Android


Hi, I am trying to build an app that when installed modifies the phone display into a size and shape. For instance, I select half the screen - the display should be compressed into half the size (rest of the screen is black). Note that I don't want to cut the display in half but it should appear like it has been compressed into half. I can probably get the compression algorithm in an image processing library but how do I do this in android. I would like to do this for anything that is on display while my app is running in background but even for my own app - if I have a constantly changing screen, how do I do this? I looked at some magnify glass apps, so the method must be somewhat similar I think.