Hello casetta developers,
I requested a new function ofr casetta in the wishlist and i had the
pleasure to see that it was added to the roadmap. I began to implement
this function (See
pictures.py in the attachment). I put this function in the pictures.py
but I don't know if it is the good location.
This function takes a normalized picture and returns a Casio Basic
Program which draws the picture.
This function only use the F-line instruction (and only Horizontal
F-lines) and Plot-On instructions. Therefore, it is not very optimised
to produce Basic Programs which consume few memory.
I have also reported a bug #2 about casetta : here is a video to
explain what I get. The script I used to test this function is :
#-*- coding: utf-8 -*-
import casetta.pictures as pic
import Image
from os import chdir
path='/home/fabien_kubuntu/tux_casetta.png'
im=Image.open(path)
im_table=list(im.getdata())
print len(imn)
im_basic=pic.img_to_basic(im_table)
print im_basic
programme_final="%Header Record\nFormat:TXT\nData Type:PG\nFile
Name:TestF\nPassword:\n%Data Record\n"+"\Cls\n"+im_basic
chdir('/home/fabien_kubuntu/')
file=open('TestF.newcat', 'w')
file.write(programme_final)
file.close()
--
Fabien
ANDRE aka Xion345
Microsoft is not the
answer. Microsoft is the question. NO (or Linux) is the answer. (
Unknown, Not dated )