I need to generate wx.Bitmap with a hole in them, i.e. the whole bitmap
is one colour, greyish with alpha = 255*.6, except for one rectangle
that has alpha = 0 .
Currently I'm doing this with PIL, thus:
def _init_mask( self ):
mask = Image.new( 'RGBA', self.size,
color=op
"Tompa" <[EMAIL PROTECTED]> wrote:
> Yes, I believe so too. Something like this, as suggested by Benjamin:
> sys.stdout.write('Status: 200 OK\r\n')
> sys.stdout.write('Content-type: image/gif\r\n')
> sys.stdout.write('\r\n')
> im.save(sys.stdout, "GIF")
>
> But it does not work for some reason!?
Tompa <[EMAIL PROTECTED]> writes:
>> The other thing you may need to check is the HTTP header of the
>> generated image.
> If possible I'd rather separate the HTTP/HTML-stuff from image creation.
> I'd like to have an HTML file that refers to a py-file that cr
Tompa wrote:
> Benjamin Niemann odahoda.de> writes:
>> You are almost there.
> I don't feel so...
>
>> Your create_image.py does not return anything to the
>> browser yet.
> Yes, I am aware of that but I do not what to return.
>
>> First return proper HTTP headers, e.g.
>>
>> sys.stdout.write(
Max Erickson gmail.com> writes:
>
> check out sparklines:
>
> http://bitworking.org/projects/sparklines/
>
> It is a script very similar to what you want to do.
This sure looks interesting! Strange that I couldn't find this when I googled
for this kind of stuff...
I will check it out - thanks
age.
If possible I'd rather separate the HTTP/HTML-stuff from image creation.
I'd like to have an HTML file that refers to a py-file that creates images
which are returned somehow (sys.stdout or something else in memory) and
incorporated within the HTTP-response.
> It should be possi
Benjamin Niemann odahoda.de> writes:
> You are almost there.
I don't feel so...
> Your create_image.py does not return anything to the
> browser yet.
Yes, I am aware of that but I do not what to return.
> First return proper HTTP headers, e.g.
>
> sys.stdout.write('Status: 200 OK\r\n')
> sys.s
Tompa <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Hi,
>
> I would like to create images on the fly as a response to an http
> request. I can do this with PIL like this (file create_gif.py):
> from PIL import Image, ImageDraw
>
check out sparklines:
http://bitworking.org/projects/sp
> print ''
>
>
> However, I would like to 1) avoid saving the image in a file on disk and
> 2) separate the HTLM code from the python image creation code.
>
> Something like this is what I have in mind:
> (file index.html):
>
>
> Python D
gt;
> print 'Status: 200 OK'
> print 'Content-type: text/html'
> print
> print 'Python Dynamic Image Creation
> Test'
> print ''
> im = Image.new("P", (600, 400))
> draw = ImageDraw.Draw(im)
> draw.rectangle((0, 0) + im.size, fi
Hi,
I would like to create images on the fly as a response to an http request.
I can do this with PIL like this (file create_gif.py):
from PIL import Image, ImageDraw
print 'Status: 200 OK'
print 'Content-type: text/html'
print
print 'Python Dynamic Image Creation Test
11 matches
Mail list logo