• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# 2d resize

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1pr0teus  Members

Posted 01 March 2000 - 11:14 AM

I have a square image which I need to resize to another square image. Right now, I have nested for loops for the resize, something like this:  for(int rows = 0; rows < (int)destDim; ++rows) { sampleX = 0; for(int cols < (int)destDim; ++cols) { newImage[rows][cols] = sourceImage[(int)sampleY][(int)sampleX]; sampleX += sampleRate; } sampleY += sampleRate; }  Where sampleY and sampleX are the source dimensions / destination dimensions. Any help is appreciated. Right now, it seems to rotate the image 45 degrees and place the upper right part of the image in the lower left corner. The left edge seems to be alright, however.

### #2Camel6  Members

Posted 01 March 2000 - 02:53 PM

Your obvious problem is that you are not taking into consideration the actual apmatrix infestation library. You see, in order to understand what the resize is doing you must cout<< at many points in the program to trouble shoot. After you have completed this endever, you may want to try inserting random if() statements to solve your problems. Last but certainly not least, you should learn how to finish an actual game once and for all, not just do the minimum, but actually complete a game to show you "actual programming skills" Benny.

### #3WytRaven  Members

Posted 01 March 2000 - 07:08 PM

quote:
Original post by Camel6

Your obvious problem is that you are not taking into consideration the actual apmatrix infestation library. You see, in order to understand what the resize is doing you must cout<< at many points in the program to trouble shoot. After you have completed this endever, you may want to try inserting random if() statements to solve your problems. Last but certainly not least, you should learn how to finish an actual game once and for all, not just do the minimum, but actually complete a game to show you "actual programming skills" Benny.

Excuse me but I could have sworn that these message boards were here for the purpose of allowing people of any skill level to ask questions without having to worry about lamers like yourself trashing them just for the sake of gratifying there obviously swollen egos. Sorry but It really ticks me off when I see people just trying to get some help and having to put up with this kind of bullshit! You don''t get good without asking questions and you don''t start good either it takes work and effort and great places like Gamedev.net to help you on your journey. So please for the sake of everyone save your personal attacks for people that care about your opinion.

Sorry once again for getting on the soapbox but I felt that it needed saying.

### #4WytRaven  Members

Posted 01 March 2000 - 07:21 PM

If you have access to the dxsdk then you can perform a stretch blit, which is achieved simply by using the Blt method of a DirectDraw surface object and passing your source rectangle at the original size, and setting the destination rectangle to the size you want to stretch/compress too. Hope this is some help.

### #5pr0teus  Members

Posted 02 March 2000 - 09:56 AM

I know of the Blt function. This is for a DOS program, and I must use 2d arrays.

The resize isn''t really necessary, but I want some extra credit.

By the way, that first reply was from one of my friends hassling me for this. It was all in the sake of fun. I realize no one else knew this though, for I''m against such attacks.

Ben

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.