[Gambas-user] Reading screen into image/picture

vuott at tiscali.it vuott at tiscali.it
Tue Aug 28 12:27:51 CEST 2018


  
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 [1] ]----
> 
> Con
MyOpen hai Giga, SMS e i minuti che vuoi da 3EUR al mese, per sempre.
Cambi gratis quando e come vuoi e in più hai 10EUR di credito omaggio!
>
SCOPRI DI PIU' http://tisca.li/myopen [2]
  


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180828/5313883c/attachment.html>


More information about the User mailing list