Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > after an image is moved to a new location, how to delete the image at the old location?

Reply
Thread Tools

after an image is moved to a new location, how to delete the image at the old location?

 
 
zxo102
Guest
Posts: n/a
 
      08-01-2006
Hi everyone,
As shown in the code below (modified based on the Image.py in
wxpython demo), an image is created at location 1: (50,10) with
rotated angle 1.12. Now, suppose I got another set of new data, I want
to move the image to location 2: (166,400) with rotated angle 1.5.
case 1:
if I use
"wx.StaticBitmap(panel, -1, bmp2, (166, 400), (bmp2.GetWidth(),
bmp2.GetHeight()))",
everything is fine but I don't know how to delete the image at
location 1.
case 2:
If I use
"kk.SetBitmap(bmp2)" (see the code below),
the rotated image (angle 1.5) is put to location 1: (50,10)
instead of location 2: (166,400). Or I don't know how to move the image
to the new location (166,400).

anybody knows how to solve the above problem? Thanks a lot.

Ouyang


#############################################
def runTest(frame, nb, log):
bmp = wx.Image(opj('bitmaps/image.bmp'), wx.BITMAP_TYPE_BMP)
bmp.SetMask(True)

# image.bmp is originally located in (50,10) with rotated angle
1.12
x = 50
y = 10
angle = 1.12
bmp1 = bmp.Rotate(angle, (x,y), True,None)
bmp1 = bmp1.ConvertToBitmap()
panel = wx.Panel(nb, -1)

kk = wx.StaticBitmap(panel, -1, bmp1, (x, y), (bmp1.GetWidth(),
bmp1.GetHeight()))

# Now image.bmp is relocated at (166,400) with rotated angle 1.5

x= 166
y = 400
angle = 1.5
bmp2 = bmp.Rotate(angle, (x,y), True,None)
bmp2 = bmp2.ConvertToBitmap()
wx.StaticBitmap(panel, -1, bmp2, (x,y), (bmp2.GetWidth(),
bmp2.GetHeight()))

#kk.SetBitmap(bmp2)

return panel
################################################## #########3

 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
"return delete (new int)" compile but "return delete (new X X C++ 4 07-19-2010 05:47 PM
Mixing new/delete and operator new/delete? Jef Driesen C++ 1 01-19-2005 01:56 PM
pagefile, how to delete from C: drive when I've moved it to the E: drive glenwood Computer Support 2 08-22-2003 02:07 PM
Overloading new[] and delete[]: how do they vary from new and delete? HeroOfSpielburg C++ 1 08-06-2003 03:58 AM



Advertisments