| Reply | « Previous Thread | Next Thread » |
|
Friends
I had googled around and it seems that starting from PyS60 1.2 there is a new function for image objects ('getpixel') that returns pixels values from one image in a given coordinate. I was wondering if there is an equivalente 'setpixel' function to change/add pixels in an image object? If not, is there a way to create an image with a given dimension (say, 640 x 480) and fill in the pixel values of it? It would be nice to being able to set whole lines and/or columns at just 1 function call too! :-) Best regards Savago |
|
You can load an image into canvas. And use the point() method to "setpixel"...
Something like this: Code:
x = 10 y = 10 color = 0x000000 appuifw.app.body.point((x, y), color) |
| Jan Rune Johansen |
| View Public Profile |
| Find all posts by Jan Rune Johansen |
|
I actually have a little example of the point method here that i used for a test:
Code:
import e32 import appuifw import graphics fullscreen = 1 x = 10 y = 10 color = 0xFFFFFF bg_color = 0x000000 def exit(): global fullscreen fullscreen = 0 appuifw.app.screen = 'full' canvas = appuifw.Canvas() appuifw.app.body = canvas canvas.clear(bg_color) appuifw.app.exit_key_handler= exit while fullscreen: appuifw.app.body.point((x, y), color) e32.ao_sleep(0.5) |
| Jan Rune Johansen |
| View Public Profile |
| Find all posts by Jan Rune Johansen |
|
Dear Jan Rune Johansen
Thanks a lot for your message. I will test the code and report back later. The only problem that I can see with this approach is that its a bit cpu intensive (i.e. for a typical display of 320x240 pixels it will require 76800 functions calls to fill in an image of the same size). Is there a way to fill one row or column with *just* 1 function call? Or even better, present one array with all raw pixel data (say RGB, RGB, etc..) and fill in the canvas/image object at once? Best regards Savago |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Stroring Objects into RecordStore does degrades performance? | rohitverma81 | Mobile Java General | 1 | 2006-11-08 06:04 |
| Active objects in EXE second thread | inguvaseshu | Symbian Networking & Messaging | 8 | 2006-08-10 06:35 |
| Bubble sort a list of linked objects! | hclemson | General Symbian C++ | 2 | 2005-05-15 14:39 |
| panicking active objects | kratom | General Symbian C++ | 0 | 2003-04-18 08:20 |
| How do I use Find() method of CArrayPtrFlat holding CBase objects? | nawkboy | General Symbian C++ | 0 | 2003-02-27 21:28 |