• Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying pixels change row by row!  RSS feed

 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

I've got this code here which simply scans the whole pic to replace it with a new pic! So if i've got pic1 and pic2, every pic2 pixel will replace every pic1 pixel, and with every pixel change, the screen will be painted! and thus i visibly see the changes pixel by pixel...

this is the code that does it for me



Now, what I want to do, rather than visibly seeing every pixel change, i want to only see when a whole row of pixels has changed! I tried doing it this way (see the code below), but it doesnt show any changes! It behaves funny, and i think it only changes the first row of pixels rather than the whole image!



So can someone point out what i'm doing wrong?

Thank you
HannaH
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The index into the array only takes "i" into account, not "j". It should be something like "i * width + j". But then you'll have column-wise processing. If you want row-wise processing, switch the two for loops.
[ October 20, 2007: Message edited by: Ulf Dittmer ]
 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much
you've made my day since the first time you answered my first question...

Ulf Dittmer = a bonus to the forum
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!