[Gambas-user] Drawing Area Location in Screenshot Depends on Window Location on Desktop
Fabien Bodard
gambas.fr at ...626...
Wed Feb 5 18:13:33 CET 2014
And hOmage=daChart.grab ?
Le 5 févr. 2014 17:29, gambas.fr at ...626... a écrit :
Use dachart.screenx, dachart.screeny. and you will have what you want.
It's the position of the control on the entire screen.
Le 5 févr. 2014 16:42, "Louis W. Adams, Jr." <LouisWAdamsJr at ...407...> a
écrit :
I have a drawing area control daChart on a form. To extract an image of
that
control area using screenshot, I expected that the following would work,
where picSave is a Picture object. The number 28 accounts for the window
control frame at the top for my screen resolution in Ubuntu (1920x1080).
picSave = Desktop.Screenshot()
With daChart
picSave = picSave.Copy(Me.Left + .X, Me.Top + .Y + 28, .Width, .Height)
End With
Instead I must do what follows.
picSave = Desktop.Screenshot()
With daChart
If (Me.Left > 0) Then
picSave = picSave.Copy(Me.Left + 2 * .X, Me.Top + 2 * .Y + 28,
.Width, .Height)
Else
picSave = picSave.Copy(Me.Left + .X + 1, Me.Top + .Y + 28, .Width,
.Height)
Endif
End With
In other words, if the form is not at the left edge of the desktop then I
must double the drawing area control coordinates. I see nothing wrong with
coordinate values of the form or the control as reported by the debugger,
and Screenshot() is unaffected by form location on the desktop, so the
problem might be in the Copy method.
Here are my system particulars.
[System]
Gambas=3.5.2
OperatingSystem=Linux
Kernel=3.11.0-15-generic
Architecture=x86_64
Distribution=Ubuntu 13.10
Desktop=GNOME
Theme=QGtk
Language=en_US.UTF-8
Memory=32135M
[Libraries]
Cairo=libcairo.so.2.11200.16
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.4
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.200.0
GTK+=libgtk-x11-2.0.so.0.2400.20
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.43.0.0
Qt4=libQtCore.so.4.8.4
SDL=libSDL-1.2.so.0.11.4
Lou
--
View this message in context:
http://gambas.8142.n7.nabble.com/Drawing-Area-Location-in-Screenshot-Depends-on-Window-Location-on-Desktop-tp45541.html
Sent from the gambas-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list