Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Show picture+Make it disapear after a Delay
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Show picture+Make it disapear after a Delay
I need to know if it's possible to show a picture onscreen and make it disapear after a certain amount of time, let's say 10seconds.If i disable the Show Picture action the picture won't fade away so i wonder
Thank you
Thank you
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
It is very simple:Maybe you did not understand what it means to use empty path to clear.
Delays 10s you can do so easily, as shown in the first macro.
It has but one drawback - EventGhost throughout the delay just waiting and can not perform any other activities (the icon is yellow).
If it matters, you need to do more complicated. This is shown in the second and third macro.
Insert the plugin SchedulGhost and create a schedule based on this picture:And that's all.
Pako
Delays 10s you can do so easily, as shown in the first macro.
It has but one drawback - EventGhost throughout the delay just waiting and can not perform any other activities (the icon is yellow).
If it matters, you need to do more complicated. This is shown in the second and third macro.
Insert the plugin SchedulGhost and create a schedule based on this picture:And that's all.
Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Show picture+Make it disapear after a Delay
All right this is good i have found out the other day actually using Wait time but wasn't aware of the others solutions.
Now i have another issue it seems the picture is shown in a black blackground and i'd like it to be transparent.
I have tried RGB32 pictures without much luck, also tried .PNG
Also, i'd like to position the picture to a specific spot onscreen, not sure if i can do that with eventghost
Now i have another issue it seems the picture is shown in a black blackground and i'd like it to be transparent.
I have tried RGB32 pictures without much luck, also tried .PNG
Also, i'd like to position the picture to a specific spot onscreen, not sure if i can do that with eventghost
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
On so specific task has EventGhost prepared no action.themaster1 wrote:Now i have another issue it seems the picture is shown in a black blackground and i'd like it to be transparent.
I have tried RGB32 pictures without much luck, also tried .PNG
Also, i'd like to position the picture to a specific spot onscreen, not sure if i can do that with eventghost
You must use the action Python script.
Here is one possible solution:
Code: Select all
imageFile = "D:\Data\Pictures\GreenPunkt5.png"
#imageFile = "D:\Data\Pictures\Log_7.gif"
onTop = True
#onTop = False
size = None
#size = (128,128)
pos = (400, 50)
#pos = None
delay = 10
#delay = 0
#----------------------------------------------------------------------
class ShapedFrame(wx.Frame):
def __init__(self, imageFile, onTop, size, pos, delay):
style = wx.FRAME_SHAPED | wx.SIMPLE_BORDER | wx.FRAME_NO_TASKBAR
if onTop:
style |= wx.STAY_ON_TOP
wx.Frame.__init__(self, eg.document.frame, -1, "Shaped Window", style = style)
self.hasShape = False
self.delta = (0,0)
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
self.Bind(wx.EVT_RIGHT_UP, self.OnExit)
self.Bind(wx.EVT_TIMER, self.OnExit)
self.Bind(wx.EVT_PAINT, self.OnPaint)
#self.bmp = wx.Image(imageFile, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
img = wx.Image(imageFile, wx.BITMAP_TYPE_ANY)
if size:
img.Rescale(size[0], size[1])
self.bmp = img.ConvertToBitmap()
#self.bmp = wx.BitmapFromImage(img)
if delay:
self.timer = wx.Timer(self)
self.timer.Start(1000*delay)
# wx.CallAfter(self.timer.Start, 1000*delay)
else:
self.timer = None
w, h = self.bmp.GetWidth(), self.bmp.GetHeight()
self.SetClientSize((w, h))
self.SetWindowShape()
dc = wx.ClientDC(self)
dc.DrawBitmap(self.bmp, 0,0, True)
if pos:
self.SetPosition(pos)
else:
self.Center()
self.Show(True)
def SetWindowShape(self, *evt):
# Use the bitmap's mask to determine the region
r = wx.RegionFromBitmap(self.bmp)
self.hasShape = self.SetShape(r)
def OnPaint(self, evt):
dc = wx.PaintDC(self)
dc.DrawBitmap(self.bmp, 0,0, True)
def OnExit(self, evt):
if self.timer:
self.timer.Stop()
del self.timer
self.Close()
def OnLeftDown(self, evt):
self.CaptureMouse()
x, y = self.ClientToScreen(evt.GetPosition())
originx, originy = self.GetPosition()
dx = x - originx
dy = y - originy
self.delta = ((dx, dy))
def OnLeftUp(self, evt):
if self.HasCapture():
self.ReleaseMouse()
def OnMouseMove(self, evt):
if evt.Dragging() and evt.LeftIsDown():
x, y = self.ClientToScreen(evt.GetPosition())
fp = (x - self.delta[0], y - self.delta[1])
self.Move(fp)
#----------------------------------------------------------------------
wx.CallAfter(ShapedFrame, imageFile, onTop, size, pos, delay)Pictures PNG or GIF are correctly displayed including alpha transparency channel.
Additionally, you can choose the following parameters:
onTop (True or False)
size (if size = None, the picture is shown in its natural size)
pos (if pos = None, the picture is located in the center)
delay (if delay = 0, the picture itself not disappear and you must right-click to disappear)
To create this script, I used a modified example "ShapedWindow" from wxPython DEMO application.
Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Show picture+Make it disapear after a Delay
There is a problem with this python script i'm affraid:
error messages:
I have doubled checked the path to my image in the script and it's ok
I don't understand why it put C:\Documents and Settings\User1\Bureau est.bmp the path i have written is as follow: imageFile = "C:\Documents and Settings\User1\Bureau\test.bmp"
I have tried with a .png aswell ,same result
error messages:
Code: Select all
16:58:46 wxError1: Can't load image from file 'C:\Documents and Settings\User1\Bureau est.bmp': file does not exist.
16:58:46 Traceback (most recent call last):
16:58:46 File "wx\_core.pyc", line 14618, in <lambda>
16:58:46 File "wx\_core.pyc", line 3369, in ConvertToBitmap
16:58:46 wx._core.PyAssertionError: C++ assertion "image.Ok()" failed at ..\..\src\msw\bitmap.cpp(802) in wxBitmap::CreateFromImage(): invalid imageI don't understand why it put C:\Documents and Settings\User1\Bureau est.bmp the path i have written is as follow: imageFile = "C:\Documents and Settings\User1\Bureau\test.bmp"
I have tried with a .png aswell ,same result
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
Try to edit it according to the following example:
Pako
Code: Select all
imageFile = r"C:\Documents and Settings\User1\Bureau\test.bmp"-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Show picture+Make it disapear after a Delay
It seems to be working except the background is not transparent.. 
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
And that picture really has a transparent background?themaster1 wrote:It seems to be working except the background is not transparent..
You can put it here?
Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Show picture+Make it disapear after a Delay
Yes it is transparent i work with Flash Pro and photoshop
http://img834.imageshack.us/img834/3383/forpako.png
Also it seems that animated .GIF are not well displayed only 1 frame not the entire animation
Gif animation:
http://img560.imageshack.us/img560/1158 ... mation.gif
http://img834.imageshack.us/img834/3383/forpako.png
Also it seems that animated .GIF are not well displayed only 1 frame not the entire animation
Gif animation:
http://img560.imageshack.us/img560/1158 ... mation.gif
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
I thought so. There is not a transparent background.
Try this picture:Pako
Try this picture:Pako
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
Yes, it's true.themaster1 wrote:Also it seems that animated .GIF are not well displayed only 1 frame not the entire animation
This solution does not support animated GIFs.
But I have not noticed that here was such a requirement.
Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Show picture+Make it disapear after a Delay
Sorry but it don't work with your picture, it display a gray background, take a look:
http://img856.imageshack.us/img856/585/0000kc.jpg
http://img856.imageshack.us/img856/585/0000kc.jpg
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
Yes, you're right.themaster1 wrote:Sorry but it don't work with your picture, it display a gray background, take a look:
http://img856.imageshack.us/img856/585/0000kc.jpg
Very sorry, but the picture itself has changed (during the upload / download) !
I did not know that this can happen.It should be this picture:

You can see that this time I also used an external link and not send my picture directly.
Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Show picture+Make it disapear after a Delay
Yeah it's working now, can you tell me what you did , what software you used ?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show picture+Make it disapear after a Delay
PhotoFiltre V6 (free)themaster1 wrote:Yeah it's working now, can you tell me what you did , what software you used ?
Pako