| Reply | « Previous Thread | Next Thread » |
|
Hello! I´m having a problem debugging the following script:
------------------------------------ import appuifw, graphics, e32, key_codes mask_img = graphics.Image.new(size=(50,50), mode='1') mask_img.load(u"E:\\Python\\mask_img.png") src_img = graphics.Image.open(u"E:\\Python\\orig_img.png") ------------------------------------- I have in that directory a file called orig_img.png . The error is: File "c:\resource\graphics.py", line 104, in load self._image.load(self._filename, self_callback) SymbianError:[Errno -1] Bye! kErrNotFound |
|
Hi,
Is this a complete code or a part of the code? Jajal Mehul |
|
The script follows this way:
canvas = appuifw.Canvas() appuifw.app.body = canvas canvas.blit(src_img, target=(0,0), source=(0,0), mask = mask_img) but I became an error when loading the file "mask_img.png". Bye! |
|
Hi BAM8
Try this code it is working with my phone Code:
import graphics
import e32
import appuifw
can=appuifw.Canvas()
appuifw.app.body=can
m=graphics.Image.new(size=(585,834), mode='1')
i=graphics.Image.open("e:\\1.jpg")
m.load("e:\\2.jpg")
can.blit(i,target=(0,0),source=(0,0),mask=m)
e32.ao_sleep(5)
Jajal Mehul |
|
Hi,
Have you check the size of the file mask_img.? It should be (50,50) because you create a new image with that size. Jajal Mehul |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
Hi BAM8, Well, I have answered this same question some days ago. Take a look at this thread. And next time, please use the search function of the DiBo to see if your question has been answered before creating a new thread. Then, we won't have repeated threads and the forum will be cleaner ![]() EDIT: I also made an article on the Wiki for getting things easier. ![]() BR, Rafael.
Last edited by Rafael T. : 2008-10-30 at 21:16.
|
|
Hello! Thank you, I had a problem with the size of the file but now... I have another problem, if I don´t create a file called mask_img.png and paste it in the directory , it returns an error and if I create it the image doesn´t change, that´s to say, in the mask_img.png I don´t have a copy of src_img. Bye!
|
|
Hi,
i cant get your problem. Can you please explain it in detail? Jajal Mehul |
|
Hello! Yes,of course, I can explain it in detail: The problem now is that if I don´t create a file called "mask_img.png" I get an error, but if I create it, I don´t get an error but I don´t get the result I want, because with the script I should get an image in black and white, a mask.
My script is: ------------------------------------------------- import graphics, e32, appuifw mask_img = graphics.Image.new(size=(675,900), mode='1') mask_img.load(u"E:\\Python\\mask_img.png") src_img = graphics.Image.open(u"E:\\Python\\orig_img.png") canvas = appuifw.Canvas() appuifw.app.body = canvas canvas.blit(src_img, target=(0,0), source=(0,0), mask = mask_img) --------------------------------------------------- |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
Are you sure your mask is the same size of your main image? I would try a smaller image for testing. Try something like a B&W icon first - size 40,40; for example ![]() BR, Rafael. |
|
Hi,
I agree with rafael , you should try it with some small image. Second thing make sure that your mask img and source img should be of the same size. You can try to resize your image so that full img is display on the canvas. Otherwise i dont think there is any problem in your script now. Jajal Mehul |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Generating Bitmap Mask for PNG images | deepchand86 | General Symbian C++ | 1 | 2008-09-24 09:17 |
| Generatin Bitmap Mask for PNG images | deepchand86 | General Symbian C++ | 3 | 2008-09-24 08:57 |
| Listbox里icon显示和释放的问题! | tianray | Symbian | 3 | 2008-09-24 03:40 |
| Incorrect rgb values for jpg images on S40 3rd ed | bjudfar | Mobile Java Media (Graphics & Sounds) | 8 | 2007-05-29 17:34 |
| Help with creating Images..Pls | rj_cybersilver | Mobile Java Media (Graphics & Sounds) | 0 | 2005-03-02 02:58 |