# How to manipulate a alpha element

**URL:** <https://www.ruby-forum.com/t/how-to-manipulate-a-alpha-element/139736>\
**Category:** Ruby-Gnome 2\
**Created:** [June 6, 2008, 3:31pm UTC](https://www.ruby-forum.com/t/how-to-manipulate-a-alpha-element/139736 "2008-06-06T15:31:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgoetzin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@pgoetzin](https://www.ruby-forum.com/u/pgoetzin)\
**Post date:** [June 6, 2008, 3:31pm UTC](https://www.ruby-forum.com/t/how-to-manipulate-a-alpha-element/139736/1 "2008-06-06T15:31:45Z")

</div>

Hello Everyone,  
im using gstreamer with ruby and i mix two video streams.  
the mixing is working fine now.

now i want to add aplha support !

first i create the element this works fine,too …

@alpha = Gst::ElementFactory.make(‘alpha’)  
@pipeline.add @alpha

then i want to set the alpha mehtod on custom and this is not working …

@alpha.set\_property(“method”, “3”)  
@alpha.method = “3”

i think the method/function aplha#method expect a “Gst::ElementAlpha”  
ENUM element and i think this dosent exists in the bingings …

right ?  
is there a hint how i can set @alpha.method = “3” ?

gst-inspect aplha output for the mehtod function  
################################################  
method : How the alpha channels should be created  
flags: readable, writable  
Enum “GstAlphaMethod” Default: 0, “set” Current:  
0, “set”  
(0): set - Set/adjust alpha  
channel  
(1): green - Chroma Key green  
(2): blue - Chroma Key blue  
(3): custom - Chroma Key on  
target\_r/g/b  
#######################################################################

thanks ahead  
& best regards

Philipp

---

<div class="post-metadata">

**Author:** ![pgoetzin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@pgoetzin](https://www.ruby-forum.com/u/pgoetzin)\
**Post date:** [June 7, 2008, 2:33am UTC](https://www.ruby-forum.com/t/how-to-manipulate-a-alpha-element/139736/2 "2008-06-07T02:33:07Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] how to manipulate a alpha element” on Fri, 6  
Jun 2008 15:31:45 +0200,  
Philipp G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> then i want to set the alpha mehtod on custom and this is not working …
> 
> @alpha.set\_property(“method”, “3”)  
> @alpha.method = “3”

@alpha.set\_property(“method”, 3)

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![pgoetzin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@pgoetzin](https://www.ruby-forum.com/u/pgoetzin)\
**Post date:** [June 7, 2008, 10:52am UTC](https://www.ruby-forum.com/t/how-to-manipulate-a-alpha-element/139736/3 "2008-06-07T10:52:07Z")

</div>

Kouhei S. wrote:

> Hi,
> 
> In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> “[ruby-gnome2-devel-en] how to manipulate a alpha element” on Fri, 6  
> Jun 2008 15:31:45 +0200,  
> Philipp G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > then i want to set the alpha mehtod on custom and this is not working …
> > 
> > @alpha.set\_property(“method”, “3”)  
> > @alpha.method = “3”
> 
> @alpha.set\_property(“method”, 3)
> 
> ## Thanks,
> 
> kou

Hello kou,

its working, sorry it was a stupid fault … 😉

thank you!

Philipp
