Xojo Conferences
MBSOct2019CologneDE

Re: transparent spritesurface? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Valentina, OUTER JOIN and DISTINCT done.
Next thread: Primary Keys


Re: transparent spritesurface?   -   Ben Gotow
  Re: transparent spritesurface?   -   Joseph J. Strout
   transparent spritesurface?   -   Roger Carlson
    Re: transparent spritesurface?   -   Joseph J. Strout
     Re: transparent spritesurface?   -   Roger Carlson
      Re: transparent spritesurface?   -   Joseph J. Strout
     Re: transparent spritesurface?   -   Mr. Weasel Willits
      Re: transparent spritesurface?   -   Roger Carlson
       Re: transparent spritesurface?   -   Mr. Weasel Willits

Re: transparent spritesurface?
Date: 06.05.02 06:51 (Mon, 06 May 2002 01:51:55 -0400)
From: Ben Gotow
on 5/8/02 12:44 Ben, Roger Carlson (by way of Jon Gotow) at
<email address removed> wrote:

> Can a sprite surface ever be transparent, perhaps with a clear gif as
> the backdrop? I'm trying to lay sprites over a quicktime movie. I am
> currently doing this by pulling stills out of an editable movie and
> dumping them into the spritesurface's background, but it's slow, I
> can't play the movie at real time rates (and I'd like to go faster).
>
> thanks in advance,
>
> Roger
>
The best thing to do is to use a canvas. Its waaaaaay faster than a
spritesurface. However, a canvas will flash unless you make an offscreen
picture buffer for it. For instance:

me.graphics.drawpicture MovieFrame,0,0
me.graphics.drawpicture Rabbit,10,10
me.graphics.drawpicture Carrot,20,10
//This will flash

buffer.clearrect(0,0,me.width,me.height)
buffer.graphics.drawpicture MovieFrame,0,0
buffer.graphics.drawpicture Rabbit,10,10
buffer.graphics.drawpicture Carrot,20,10
me.graphics.drawpicture buffer,0,0
//This will not flash

Make sure you draw the movie image into the canvas. Putting a movieplayer
behind the canvas, will cause flashing too.

If you want to do fancy overlay stuff, I would suggest using a mask. Using
the buffer's mask property, you can make images semitransparent, etc... But
again, this may slow down the movie.

-Ben
>
> ---
> Subscribe to the digest: <mailto:<email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: transparent spritesurface?
Date: 09.05.02 00:56 (Wed, 8 May 2002 16:56:13 -0700)
From: Joseph J. Strout
At 1:51 AM -0400 5/6/02, Ben Gotow wrote:

>The best thing to do is to use a canvas. Its waaaaaay faster than a
>spritesurface.

For certain kinds of operations. For other (more typically
sprite-like) operations, a spritesurface is waaaaaaay faster than a
Canvas.

Cheers,
- Joe

transparent spritesurface?
Date: 07.05.02 16:50 (Tue, 7 May 2002 08:50:51 -0700)
From: Roger Carlson
Can a sprite surface ever be transparent, perhaps with a clear gif as
the backdrop? I'm trying to lay sprites over a quicktime movie. I am
currently doing this by pulling stills out of an editable movie and
dumping them into the spritesurface's background, but it's slow, I can't
play the movie at real time rates (and I'd like to go faster).

thanks in advance,

Roger

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: transparent spritesurface?
Date: 07.05.02 18:11 (Tue, 7 May 2002 10:11:36 -0700)
From: Joseph J. Strout
At 8:50 AM -0700 5/7/02, Roger Carlson wrote:

>Can a sprite surface ever be transparent, perhaps with a clear gif
>as the backdrop?

No. That's incompatible with the whole design of the SpriteSurface
engine (which works by only redrawing the areas of the screen that
need to be redrawn).

> I'm trying to lay sprites over a quicktime movie. I am currently
>doing this by pulling stills out of an editable movie and dumping
>them into the spritesurface's background, but it's slow

I bet! There's no point in even using a SpriteSurface under these
conditions, since it has to redrawn the entire screen on every frame.
You'd probably be better off drawing the "sprites" yourself on top of
the movie frames in a Canvas.

HTH,
- Joe

Re: transparent spritesurface?
Date: 07.05.02 19:24 (Tue, 7 May 2002 11:24:25 -0700)
From: Roger Carlson

On Tuesday, May 7, 2002, at 10:11 AM, Joseph J. Strout wrote:

>> I'm trying to lay sprites over a quicktime movie. I am currently
>> doing this by pulling stills out of an editable movie and dumping them
>> into the spritesurface's background, but it's slow
>
> I bet! There's no point in even using a SpriteSurface under these
> conditions, since it has to redrawn the entire screen on every frame.
> You'd probably be better off drawing the "sprites" yourself on top of
> the movie frames in a Canvas.

wow, so the canvas is faster than a spritesurface? that's surprising.

hmm, could the canvas be mostly transparent and lay over a movie player?

I'm trying to put some measuring sticks on screen, so when the
fishcounters are watching the fish movies, they can measure them and
tell if they are jacks or adults. They need to move the rulers around,
typically when the movie is stopped, and then the rulers need to persist
when the movie is being played.

I'd like to get back to using a movieplayer instead of a spritesurface
(or a canvas) since I think it can play a movie faster (ie, at real
time) than we can handle a stack of stills. If I'm not mistaken, when I
grab a still from an editable movie, I am always grabbing a high quality
image, and the player can show lower quality images if it needs to, to
keep the frame rate up.

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: transparent spritesurface?
Date: 07.05.02 20:56 (Tue, 7 May 2002 12:56:39 -0700)
From: Joseph J. Strout
At 11:24 AM -0700 5/7/02, Roger Carlson wrote:

>wow, so the canvas is faster than a spritesurface? that's surprising.

Only under certain (non-sprite-like) conditions. (Be sure to check
out the premier issue of RB Developer magazine for a more in-depth
discussion!)

>hmm, could the canvas be mostly transparent and lay over a movie player?

No, but on a canvas you can do your own compositing however you want.

>I'd like to get back to using a movieplayer instead of a
>spritesurface (or a canvas) since I think it can play a movie faster
>(ie, at real time) than we can handle a stack of stills. If I'm not
>mistaken, when I grab a still from an editable movie, I am always
>grabbing a high quality image, and the player can show lower quality
>images if it needs to, to keep the frame rate up.

All true, however I don't know of an easy way at the moment to
overlay graphics on top of a playing movie in RB.

Cheers,
- Joe

Re: transparent spritesurface?
Date: 08.05.02 02:55 (Tue, 07 May 2002 18:55:37 -0700)
From: Mr. Weasel Willits
On 5/7/02 10:11 AM, the NSA intercepted the following message from "Joseph
J. Strout" <<email address removed>>:

> I'm trying to lay sprites over a quicktime movie. I am currently
>doing this by pulling stills out of an editable movie and dumping
>them into the spritesurface's background, but it's slow

I wonder if QT sprites have better alphas. Maybe you could use them if they
did.

--------------------Seth Willits-------------------
How many guys does it take to screw in a light bulb?
One! Are you stupid or something?
________ http://freaksoftware.tripod.com/ _________


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: transparent spritesurface?
Date: 08.05.02 04:40 (Tue, 7 May 2002 20:40:19 -0700)
From: Roger Carlson

On Tuesday, May 7, 2002, at 06:55 PM, Mr. Weasel Willits wrote:

> On 5/7/02 10:11 AM, the NSA intercepted the following message from
> "Joseph
> J. Strout" <<email address removed>>:
>
>> I'm trying to lay sprites over a quicktime movie. I am currently
>> doing this by pulling stills out of an editable movie and dumping
>> them into the spritesurface's background, but it's slow
>
> I wonder if QT sprites have better alphas. Maybe you could use them if
> they
> did.

I don't care about the alphas, I need speed. My movie has 10 frames per
second, and I can run it at around 7 or 8 (G4 450). I want to be able to
go a lot faster.

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: transparent spritesurface?
Date: 08.05.02 08:06 (Wed, 08 May 2002 00:06:40 -0700)
From: Mr. Weasel Willits
On 5/7/02 8:40 PM, the NSA intercepted the following message from "Roger
Carlson" <<email address removed>>:

>>> I'm trying to lay sprites over a quicktime movie. I am currently
>>> doing this by pulling stills out of an editable movie and dumping
>>> them into the spritesurface's background, but it's slow
>>
>> I wonder if QT sprites have better alphas. Maybe you could use them if
>> they
>> did.
>
> I don't care about the alphas, I need speed. My movie has 10 frames per
> second, and I can run it at around 7 or 8 (G4 450). I want to be able to
> go a lot faster.

Oh sorry. I was thrown off by the subject line.

Even still, I know QuickTime lets you do this. I'll have to look at some
code and get back to you about it though.

------------------Seth Willits---------------
Microsoft is to Apple as Honda is to Ferrari
_____ http://freaksoftware.tripod.com/ ______


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>