![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello there,
I've got a bitmap which have a grid (horizontal and vertical lines). In this grid I'm plotting values from left to right. If I'm on the right end I will scroll the bitmap one pixel to the left. To do that I have a loop that counts on bitmap.width. Within that loop there is another loop (bitmap.height) reading the pixel color of the right neightbor and plots them to the actual position. On the desktop application it's fast enough to have a "scrolling effect". But on my mobile device it's extremly slow and totally unusable. The bitmap have a size of 100x80 - so there are 8000 get / setpixel-commands. Too much for my mobile ![]() Does anyone have an idea to scroll bitmaps ? ![]() |
|
|||
|
Scrolling means that the whole image will be moved by one pixel to the left. The now missing pixel on the right will be redrawn.
If this will be done every second, you have a scrolling effect (like on jump'n'run games) There is some example of my code: Code:
For i=0 To bitmap1.Width-2 For ii=1 To bitmap1.Height-2 wi.text = i wii.text = ii col = bitmap1.getpixel1(i+1,ii) Select col Case cWhite bitmap1.SetPixel(i,ii,cWhite) Case cBlack bitmap1.SetPixel(i,ii,cBlack) Case cRed bitmap1.SetPixel(i,ii,cRed) End Select bitmap1.SetPixel(bitmap1.width-1,ii,cWhite) Next ii Next i bitmap1.SetPixel(noscroll-2,wert+120,cRed) |
|
|||
|
Quote:
![]() My main problem is that I don't have a fixed image. On start I'm drawing my grid bitmap. Then on every timer event I'm adding a pixel (value of a measurement) on that grid. After that I have to scroll the whole bitmap on one pixel and have to redraw the grid on the right side. I attached my example for a better understanding. Last edited by Roadrunner : 02-26-2008 at 07:13 AM. |
|
|||
|
Think I got it fixed now...
Normally I'm drawing my values in the bitmap directly so I have to work with the whole bitmap. Now I'm changed it to a really bitmap-file, put my values into an array and now scrolling in the way Erel is doing and then start again at the beginning. So I only have to redraw my values into the bitmap every 10 times. Thanks all for your help ![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bitmap Value Lost? | fjsantos | Questions & Help Needed | 7 | 06-16-2008 07:04 PM |
| Performance vs Memory | RandomCoder | Questions & Help Needed | 4 | 02-10-2008 05:03 PM |
| Background-Color on Bitmap.new2 | Roadrunner | Bug Reports | 1 | 12-08-2007 04:08 PM |
| Out of Memory error while loading bitmap | HARRY | Questions & Help Needed | 3 | 05-15-2007 01:12 PM |