![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Posts: 3
Rep Power: 0
![]() |
Help needed!
Hi
Im trying to create a water effect over an image and am having trouble rendering the pixels on the screen. I have setup the motion etc... and just need to draw them to the screen. Heres my source for my paint method. Any help would be much appreciated. private void paintWater() { int p = 0; for(int i = 157; i < pixels.length-157; i++) { offsetX = pixelBuffer[i-1] - pixelBuffer[i+1]; colour = 128 - offsetX; if(colour > 255) colour = 255; else if(colour < 0) colour = 0; offsetX /= 8; indexX = offsetX + i; if(indexX < 0) indexX = 0; else if(indexX > pixels.length-1) indexX = pixels.length-1; int r = ((colour & 0xFF0000) >> 16); int g = ((colour & 0x00FF00) >> 8); int b = ((colour & 0x0000FF)); pixelsNew[p++] = 0xFF000000 | (r << 16) | (g << 8) | b; } p += 2; } Thanks Dan |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
please use code tags around your code ( [C O D E][/C O D E] - no spaces)
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|