thumbnailctrl image rotate

Please define the right direction first. What do you expect and how is the current code not meeting your expectations.

Is it throwing an error?

Peter

···

On Tue, May 27, 2008 at 2:46 AM, Thomas Thomas thomas@mindz-i.co.nz wrote:

Hi All,

I tried different options still no luck in getting this bit to work the way i need it… Any pointers in the right direction is much apppreciated…

pasted below the code that andrea uses to rotate the thumbnail…

       if TN_USE_PIL:

           newangle = thumb.GetRotation()*180/pi + angle

           fil = opj(self._dir + "/" + thumb.GetFileName())

           pil = Image.open(fil).rotate(newangle)

           img = wx.EmptyImage(pil.size[0], pil.size[1])

           img.SetData(pil.convert('RGB').tostring())

           thumb.SetRotation(newangle*pi/180)

       else:

           img = thumb._threadedimage

           newangle = thumb.GetRotation() + angle*pi/180

           thumb.SetRotation(newangle)

           img = img.Rotate(newangle, (img.GetWidth()/2, img.GetHeight()/2), True)

                     thumb.SetRotatedImage(img)

Thanks

Thomas


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


There is NO FATE, we are the creators.