## Game programming

Moderators: None (Apply to moderate this forum)
Number of posts: 5331

This Forum Only

Need Help : To zoom an image through interpolation Posted by anujkawasthi on 24 Sept 2008 at 5:28 AM
Hi Everyone,
I need some help.
i loaded the bitmap image file without any graphic api and now
I am trying to zoom image trough Linear or Neighbor Interpolation and bi linear interpolation.

Thanks& Regards

Anuj Awasthi
Re: Need Help : To zoom an image through interpolation Posted by cosmic_egg on 25 Sept 2008 at 7:19 AM
: Hi Everyone,
: I need some help.
: i loaded the bitmap image file without any graphic api and now
: I am trying to zoom image trough Linear or Neighbor Interpolation
: and bi linear interpolation.
:
:
: Thanks& Regards
:
: Anuj Awasthi
:
I will just write the algo
let us suppose image in array image[x][y]
tmpimage[2x][y];
finalimage[2x][2y];
for j=0 , j<y , j++
(
z=0
for i=0 , i<x , i++
(
tmpimage[z][j] = image[i][j]
tmpimage[z+1][j] = image[i][j]
z = z+2
}
}

z = 0

for i=0 , i<x , i++
(
z = 0
for j=0 , j<y , j++
(
finalimage[i][z] = tmpimage[i][j]
finalimage[i][z+1] = tmpimage[i][j]
z = z+2
}
)

I think you can just change it to you needs.
I am have forgotton which interpolation is this but definately zooms and image.

Also for the mentioned transformation I think you could just play around with the image array
Re: Need Help : To zoom an image through interpolation Posted by cosmic_egg on 25 Sept 2008 at 7:23 AM
: : Hi Everyone,
: : I need some help.
: : i loaded the bitmap image file without any graphic api and now
: : I am trying to zoom image trough Linear or Neighbor Interpolation
: : and bi linear interpolation.
: :
: :
: : Thanks& Regards
: :
: : Anuj Awasthi
: :
: I will just write the algo
: let us suppose image in array image[x][y]
: tmpimage[2x][y];
: finalimage[2x][2y];
: for j=0 , j<y , j++
: (
: z=0
: for i=0 , i<x , i++
: (
: tmpimage[z][j] = image[i][j]
: tmpimage[z+1][j] = image[i][j]
: z = z+2
: }
: }
:
: z = 0
:
: for i=0 , i<x , i++
: (
: z = 0
: for j=0 , j<y , j++
: (
: finalimage[i][z] = tmpimage[i][j]
: finalimage[i][z+1] = tmpimage[i][j]
: z = z+2
: }
: )
:
: I think you can just change it to you needs.
: I am have forgotton which interpolation is this but definately zooms
: and image.
:
: Also for the mentioned transformation I think you could just play
: around with the image array
:

Also I think I have seen Linear or Neighbor Interpolation and bi linear interpolation. code in matlab demos or sample or tutorial
just look for it in matlab image tutorial atleast you can get the algorithm
Re: Need Help : To zoom an image through interpolation Posted by ess-image on 2 Sept 2009 at 10:18 PM
I'm not sure this will help but i have a Vb .net Function that will allow you to zoom in or out at will.
You can get the source code from http://ess-image.com/Graphic/Image_Processing/ZoomImage.aspx
While you are there you may see some other image processing functions that will help you with your game programming.

I hope this helps you out
Al

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic