IT Community - Software Programming, Web Development and Technical Support

How to enlarging an image by pixel replication?

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?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-24-2007, 06:30 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Question How to enlarging an image by pixel replication?

How to enlarging an image by pixel replication?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2007, 06:47 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: How to enlarging an image by pixel replication?

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;
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 12:30 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0