Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > wxpython display jpg in a frame

Reply
Thread Tools

wxpython display jpg in a frame

 
 
max4
Guest
Posts: n/a
 
      07-22-2003
hello
i would like to know if there is a good tutorial about how to do this
or if someone could explain

thank you

[ i want to add a jpg to an existing about dialog]
 
Reply With Quote
 
 
 
 
Cliff Wells
Guest
Posts: n/a
 
      07-22-2003
On Tue, 2003-07-22 at 12:32, max4 wrote:
> hello
> i would like to know if there is a good tutorial about how to do this
> or if someone could explain
> [ i want to add a jpg to an existing about dialog]



Capture the PAINT event and use a PaintDC to draw to the dialog:

class MyDialog(wx.Dialog):
def __init__(self, ...):
...
EVT_PAINT(self, self.OnPaint)


def OnPaint(self, event):
dc = wxPaintDC(self)
dc.DrawBitmap(bitmap, ...)
event.Skip()


BTW, questions about wxPython are better asked on the wxPython list:

http://www.wxpython.org/maillist.php

Regards,

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555


 
Reply With Quote
 
 
 
 
David C. Fox
Guest
Posts: n/a
 
      07-22-2003
max4 wrote:

> hello
> i would like to know if there is a good tutorial about how to do this
> or if someone could explain
>
> thank you
>
> [ i want to add a jpg to an existing about dialog]



Create a wxImage from the jpg file, and then a wxBitmap from the image,
then a wxStaticBitmap control from the bitmap.

for example,

i = wxImage("about.jpg", wxBITMAP_TYPE_JPEG)
b = wxBitmapFromImage(i)
sb = wxStaticBitmap(dialog, b, pos, size)

As usual, see the wxPython demo for more details.

David

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display URL of Frame 2 in Frame 1 nickkaplan@gmail.com Javascript 1 10-16-2007 09:28 AM
JPG's were nor recognised as JPG's Matthias HTML 5 06-01-2004 11:50 AM
Wrong image size of JPG after TIFF to JPG conversion with JAI Roland Java 0 05-12-2004 03:52 PM
Looking for software to combine 4 JPG images into one JPG image G.M. Durrence Digital Photography 4 04-08-2004 08:04 PM
DSCN1234.JPG vs dscn1234.jpg on COOLPIX 885 Michel Boivin, ing. Digital Photography 0 12-26-2003 06:22 PM



Advertisments