I know how to display a GIF when it is to be loaded from a file but
now need to do the same with a GIF that has been retrieved from a
database. I have spent all afternoon trying various things but nothing
works. Can someone point me in the right direction.
# open your database connection
# read the data into a string or something
data = dbConn.someQuery()
img = wx.ImageFromStream(cStringIO.StringIO(mapData))
imgCtrl = wx.StaticBitmap(imgPanel, wx.ID_ANY, wx.BitmapFromImage
(img))
</code>
Hope that gets you going at least.
···
On Dec 11, 1:38 pm, normi <ndut...@tampabay.rr.com> wrote:
Hi All,
I know how to display a GIF when it is to be loaded from a file but
now need to do the same with a GIF that has been retrieved from a
database. I have spent all afternoon trying various things but nothing
works. Can someone point me in the right direction.
I know how to display a GIF when it is to be loaded from a file but
now need to do the same with a GIF that has been retrieved from a
database. I have spent all afternoon trying various things but nothing
works. Can someone point me in the right direction.
See wx.ImageFromStream and cStringIO.StringIO to use the database field as file stream.
Regards,
···
--
*****************************************
Oswaldo Hern�ndez
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, aseg�rese de que es necesario.
El medio ambiente est� en nuestra mano.
On Dec 11, 3:02 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
On Dec 11, 1:38 pm, normi <ndut...@tampabay.rr.com> wrote:
> Hi All,
> I know how to display a GIF when it is to be loaded from a file but
> now need to do the same with a GIF that has been retrieved from a
> database. I have spent all afternoon trying various things but nothing
> works. Can someone point me in the right direction.
> Thanks, Normi
You probably just need to do something like this:
<code>
import wx, cStringIO
# open your database connection
# read the data into a string or something
data = dbConn.someQuery()
img = wx.ImageFromStream(cStringIO.StringIO(mapData))
imgCtrl = wx.StaticBitmap(imgPanel, wx.ID_ANY, wx.BitmapFromImage
(img))