You Are Here:

Community: Developer Discussion Boards

#1 Old Image with Date - 2007-02-07, 21:54

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
Dear All

I wish to print date on the image captured by camera. I mean when we take photo from camera, there should be some date to be printed on any part of the image like when we take photo using digital still camera. I dont find any details on how to write some data on image..

Thanks


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#2 Old Re: Image with Date - 2007-02-09, 06:17

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
Dear Forum

Since long i am observing that nobody is replying to my posts...!!!

Only LFD is the person who always tries to solve my problem...

Did i have done any mistake in past in asking any question? If yes then do tell me. I have come to forum for learning as i am python beginner...

If nobody is going reply my queries then it really hurts me that what is the meaning of asking...

Please help me ... i think my questions are not SO HARD for you expert guys over there...

PLEASE I REQUEST YOU>>> HELP ME

kiran


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#3 Old Re: Image with Date - 2007-02-09, 09:20

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
I don't think you are the only one getting no answers. I've noticed that this forum has stagnated in the past couple of weeks. Perhaps people are weary of waiting for PyS60 to reach stability.

As for your original question, the graphics module can be used to read image files, draw on them and save them. Unfortunately the font support is still broken on 3rd Edition, so text rendering is impossible at the moment (or at least requires a third party module).

Code:
import graphics

# Load image to memory.
img = graphics.Image.open("E:\\original.jpg")

# Modify image in memory. Draw a red rectangle in the middle.
w, h = img.size
img.rectangle((w / 3, h / 3, w * 2 / 3, h * 2 / 3), fill = (255, 0, 0))

# Save image back to disk (memory card, actually).
img.save("E:\\modified.jpg", quality = 90)
Reply With Quote

#4 Old Re: Image with Date - 2007-02-09, 12:35

Join Date: Jan 2007
Posts: 21
Location: Spain
Skarabeus
Offline
Registered User
Code:
import camera
import time

img = camera.take_photo()
img.text((20,img.size[1]-25),time.strftime("%d/%m/%Y %H:%M:%S").decode(),font=u"LatinBold19",fill=(255,255,0))

img.save("E:\\Images\\photo.jpg")
You must select the apropiate font size and color.

Bye
Reply With Quote

#5 Old Re: Image with Date - 2007-02-09, 13:00

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Quote:
As for your original question, the graphics module can be used to read image files, draw on them and save them. Unfortunately the font support is still broken on 3rd Edition, so text rendering is impossible at the moment (or at least requires a third party module).
If you want to achieve this with a 3rd edition device you can use a non-official PyS60 distribution compiled by our friend cycke64 (and not only a 3rd party module!). You can find the urls at http://discussion.forum.nokia.com/fo...ad.php?t=97573

We own this distribution to GameDude that pointed out the solution for having visible fonts with the text method. Also there are still few bugs due to the modification. Read more in the previous link I gave you.

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
--- ???save image problem??? --- ferenn Mobile Java Media (Graphics & Sounds) 6 2007-10-01 15:33
Opening a JPEG Image ummarbhutta Mobile Java Media (Graphics & Sounds) 8 2007-02-15 07:34
how to cut some part of Image mshouab Mobile Java Media (Graphics & Sounds) 2 2006-08-04 10:05
HELP: Mutable Image to Immutable Image? rj_cybersilver Mobile Java Media (Graphics & Sounds) 1 2005-03-26 10:58
Nokia Image Converter davidpurdie General Discussion 0 2004-02-18 16:31

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia