Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 12:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Cropping an image -- or how to simulate a LED VU meter
PostPosted: August 25th, 2006, 11:17 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
Hi,

(I hope this is not another stupid question...) :oops:

I'm trying to crop an image horizontally to simulate an old-fashioned LED VU meter. Each 0.10 seconds or so the Image width must change randomly to give a realistic effect. However this seemingly simple task has proved quite tricky, for I had to insert the VU Image inside a frame, change the Image size using SetObjectSize() (SetScale() doesn't work for this), then call SetPosition() to compensate for the fact that the scale is based on Image insertion point, i.e. the center, not the left. I had to experiment a lot to overcome the jitter caused by dividing odd widths by 2. It gets better if I offset the image quite a bit, but after half a minute or so the jitter starts again (I suppose SetObjectSize() deforms the Image after a while).

Please look at the attachment to see what I mean.

Isn't there a simpler way to do this?

Thanks in advance for any help.


You do not have the required permissions to view the files attached to this post.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 26th, 2006, 8:04 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
Hi Ruben,

I'm no expert with OpusScript but I tried using a different method. I appended to your IMP file... look at Page 2 for details. It does not answer your question though, as you'll need someone better at scripting and it may be to do with the way SetObjectSize() works :?:


You do not have the required permissions to view the files attached to this post.

_________________
Cheers,
Steve


For this message Steve H has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 26th, 2006, 9:31 am 
Offline

Joined: November 3rd, 2004, 12:49 pm
Posts: 59
Location: Nottingham (UK)
If the meter keeps working all the time showing random levels, then I'd probably go a simpler route and produce the whole meter as an animated GIF ...if you use enough different frames in the animation it should look pretty convincing. We made an LED meter for a website this way some years back.

Rob
www.visibleform.co.uk


For this message RobK has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 28th, 2006, 1:52 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
Steve H wrote:
I'm no expert with OpusScript but I tried using a different method. I appended to your IMP file... look at Page 2 for details. It does not answer your question though, as you'll need someone better at scripting and it may be to do with the way SetObjectSize() works :?:

Thanks Steve, your method is certainly simpler and gives a better animation -- although it has the drawback of not showing the small black rectangles (i.e. the LEDs turned off). I'll stay with it for now.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 28th, 2006, 1:55 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
RobK wrote:
If the meter keeps working all the time showing random levels, then I'd probably go a simpler route and produce the whole meter as an animated GIF ...if you use enough different frames in the animation it should look pretty convincing. We made an LED meter for a website this way some years back.

This would certainly do it, but seems a lot of work to me. I believe Opus Pro, being a complete multimedia /rich media package, should have a simple way of masking and cropping bitmaps!

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 28th, 2006, 11:46 pm 
Offline

Joined: November 3rd, 2004, 12:49 pm
Posts: 59
Location: Nottingham (UK)
rubem wrote:
This would certainly do it, but seems a lot of work to me. I believe Opus Pro, being a complete multimedia /rich media package, should have a simple way of masking and cropping bitmaps!
Maybe - but, unless you're rendering out to video, you're asking Opus to do all this work in real time at runtime - which will possibly reduce it's capability to show/do other stuff smoothly at the same time ...I usually try to reduce the runtime calculation burden of any multimedia software as much as possible to improve overall performance. You can import huge images into Opus and ask it to crop/resize them at runtime, but most folks will advise you import at the size you intend using ...for the same reason.

If you're producing an LED meter, it's pretty easy to do this with something like Animation Shop (used to come with Paint Shop Pro) ...produce the basic meter in Paint Shop Pro, or Photoshop, and then export multiple versions of it with different LEDS lit up - import into Animation Shop to make the final GIF file and adjust the timing between the various frames to suit.

Rob
www.visibleform.co.uk


For this message RobK has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 29th, 2006, 1:27 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
Hi Rubem,

I was going to suggest using an animated GIF too. (as Rob has pointed out)

rubem wrote:
Thanks Steve, your method is certainly simpler and gives a better animation -- although it has the drawback of not showing the small black rectangles.


You could try using a marked vector line in the draw tools, instead of the solid frame blocks I used. Or if you want it exact, you could easily crop the section of the LED meter with two small images and use them.

Hope this helps. :)

_________________
Cheers,
Steve


For this message Steve H has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 29th, 2006, 11:56 am 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
I may be missing something here but surely the simplest approach is to place the bar inside a smaller frame and move the bar up and down, so using the container frame to "clip" the display?

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Slideshow
PostPosted: August 29th, 2006, 2:15 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
The easiest solution is to create two Slideshows (Left & Right meters), each with 4 or 5 different VU meter "readings", then set the time for each slide to be less than 1 second, and have them appear in Random order Continuously.


You do not have the required permissions to view the files attached to this post.

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


For this message demofred has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Slideshow
PostPosted: August 29th, 2006, 8:40 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
Here is my final (if such thing exists) solution. It's pretty straighforward, uses only one bitmap for the VUs and maybe it's useful for someone. Thanks for you all for helping me think simple :)


You do not have the required permissions to view the files attached to this post.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 68 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group