473,804 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.StaticBitma p(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(b mp2)" (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('b itmaps/image.bmp'), wx.BITMAP_TYPE_ BMP)
bmp.SetMask(Tru e)

# image.bmp is originally located in (50,10) with rotated angle
1.12
x = 50
y = 10
angle = 1.12
bmp1 = bmp.Rotate(angl e, (x,y), True,None)
bmp1 = bmp1.ConvertToB itmap()
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(angl e, (x,y), True,None)
bmp2 = bmp2.ConvertToB itmap()
wx.StaticBitmap (panel, -1, bmp2, (x,y), (bmp2.GetWidth( ),
bmp2.GetHeight( )))

#kk.SetBitmap(b mp2)

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

Aug 1 '06 #1
0 1074

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11769
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
5
3050
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove event to keep the ghost image under the mouse pointer. There are three problems: (1) if the ghost image is dragged so it is partially off the edge of the screen, scrollbars appear. This not only looks bad, it can cause the page to autoscroll...
1
3113
by: Charlie | last post by:
Hi I am using the following code to create an image viewer for multiple images. var pageImage = document.images; var image = new Image(); var args = GetQuerystring(); //return arguments from querystring image.src = args.imageSource; //get image src pageImage.src = ""; pageImage.src = image.src;
4
5152
by: Chucker | last post by:
Hi Folks, I got an error that drives me crazy because it only occurs sometimes and I can`t even reproduce it. I got a __gc class here is it`s header: #pragma once #include "../empLib/empImg.h"
8
4069
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: DoCmd.SetWarnings False DoCmd.RunCommand acCmdDeleteRecord DoCmd.SetWarnings True End If ExitHere: Me!SubName.SetFocus
3
8463
by: ACaunter | last post by:
Hi there, I was wondering if there was a way to crop a peice of an ASP.Net Image, allowing the user to zoom in on only a section of the picture?? any help would be appreciated!! thanks -- AdamPC@hotmail.com
35
2677
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
0
2000
by: aris1234 | last post by:
hello.. How to upload image file in page update ..?? i have logic like this : if user upload new image then old image must delete and update DB used new name if user not upload new image then old image no delete. code form like this (i dontknow this code right or wrong, please correction if wrong) :
1
7297
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category and Brand I need to make some changes on a a number of brands in a Category
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.