[Gambas-user] Drawing Area Location in Screenshot Depends on Window Location on Desktop
Louis W. Adams, Jr.
LouisWAdamsJr at ...3300...
Wed Feb 5 16:40:01 CET 2014
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.
More information about the User
mailing list