[Gambas-user] Reading screen into image/picture

Rolf-Werner Eilert rwe-sse at osnanet.de
Tue Aug 28 15:40:31 CEST 2018


Indeed I had this idea, but it would be too much. I was thinking of a 
very fast and simple way to take a small portion of the screen as a 
still photo.

Nevertheless,thank you for pointing me to this!

Rolf

Am 28.08.2018 um 12:27 schrieb vuott at tiscali.it:
> You could also use some resources from the gb.media component.
> 
> Private pl As MediaPipeline
> 
> 
> Public Sub Form_Open()
>   
>   Dim src, sca, con, png, snk As MediaControl
>   
>   pl = New MediaPipeline
>   src = New MediaControl(pl, "ximagesrc")
> 
>   src["xid"] = CLong(0)
> ' /Imposta la dimensione della schermata:/
>   src["startx"] = 0
>   src["starty"] = 0
>   src["endx"] = Screen.W
>   src["endy"] = Screen.H
>   src["use-damage"] = False
>   sca = New MediaControl(pl, "videoscale")
>   sca["method"] = 0
>   con = New MediaControl(pl, "videoconvert")
>   png = New MediaControl(pl, "pngenc")
>   snk = New MediaControl(pl, "filesink")
>   snk["location"] = "/tmp/screenshot.png"
>   
>   src.LinkTo(sca)
>   sca.LinkTo(con)
>   con.LinkTo(png)
>   png.LinkTo(snk)
>   
> End
> 
> 
> Public Sub Button1_Click()
>   
>   Wait 2
>   
> ' /Take a "screenshot":/
>   pl.Play()
> 
>   pl.Stop()
>   
> End
> 
> 
> 
> 
> regards
> vuott
> 
> 
> 
> 
> 
> 
> 
> Il 27.08.2018 21:26 vuott at tiscali.it ha scritto:
> 
>> .GetScreenshot( ) Method of "DesktpWindow" Class is similar.
>> vuott
>>
>> Il 27.08.2018 18:12 Tobias Boege ha scritto:
>>
>>     On Mon, 27 Aug 2018, Rolf-Werner Eilert wrote:
>>
>>         Is there a chance to read a small portion of the screen into
>>         an image or picture? What I am looking for is sort of a
>>         screenshot function.
>>
>>     The GUI components have a Desktop.Screenshot method.
>>
>>     -- "There's an old saying: Don't change anything... ever!" -- Mr.
>>     Monk ----[ Gambas mailing-list is hosted by
>>     https://www.hostsharing.net ]----
>>
>>
>>
>>
>> Con MyOpen hai Giga, SMS e i minuti che vuoi da 3€ al mese, per 
>> sempre. Cambi gratis quando e come vuoi e in più hai 10€ di credito 
>> omaggio!
>> SCOPRI DI PIU’ http://tisca.li/myopen
>>
> 
> 
> 
> Con MyOpen hai Giga, SMS e i minuti che vuoi da 3€ al mese, per sempre. 
> Cambi gratis quando e come vuoi e in più hai 10€ di credito omaggio!
> SCOPRI DI PIU’ http://tisca.li/myopen
> 
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 



More information about the User mailing list