This is a discussion on How to enlarging an image by pixel replication? within the Mobile Software Development forums, part of the Software Development category; How to enlarging an image by pixel replication?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| To enlarge an image by an integer factor n, we will replicate pixels such that each pixel in the input image becomes an n x n block of identical pixels in the output image here is an simple example public static BufferedImage large(BufferedImage image, int n) { int w = n * image.getWidth(); int h = n * image.getHeight(); BufferedImage bigImage = new BufferedImage(w, h, image.getType()); for (int y=0; y < h; ++y) for (int x=0; x < w; ++x) enlargedImage.setRGB(x, y, image.getRGB(x/n, y/n)); return bigImage; } |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DPI of an Image | Anandavinayagam | C# Programming | 6 | 12-12-2008 05:53 AM |
| Mysql - Replication | write2ashokkumar | Database Support | 2 | 08-19-2008 03:04 AM |
| Convert image to other image format using CODEC in .NET 3.0 | Mramesh | C# Programming | 0 | 02-07-2008 03:33 AM |
| How to create an image from panel background Image | S.Vinothkumar | C# Programming | 1 | 10-22-2007 03:52 AM |
| How to upload an image to DB in ASP.Net? | mobilegeek | ASP and ASP.NET Programming | 6 | 09-18-2007 11:18 PM |