We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am using processing from Eclipse, i was wondering, is it possible to have transparency on the PApplet? i mean like seeing the desktop behind it or have a custom shape pop up window?
Answers
@JDev -- this reference entry for
background()
makes me suspect it is not possible when using PApplet: https://processing.org/reference/background_.htmlHowever, Java Swing does support app window transparency (depending on the OS).
If it is possible to copy image data from a PGraphics buffer (which supports transparency) into a primary Swing window in a single Java application, then that might work...?
The solution may also be renderer-specific (JAVA2D vs P2D / P3D). See recent discussion of shaped windows and of standalone Java2D:
Remember that any such method will only work with JAVA2D and maybe the new FX2D (which is again using a standard Java renderer).
Is there any documentation about the difference between these renderers mentioned in the prev post and details of P2D/P3D?
Kf
@quark or @GoToLoop might know if there is documentation on renderer differences -- they were the respondents on those linked threads.
JAVA2D uses the java.awt.Graphics2D.
FX2D uses the javafx.scene.canvas.GraphicsContext.
P2D and P3D are based on OpenGL and were built by Procesing.
@JDev A recent discussion, and relevant to your question: https://forum.processing.org/two/discussion/20499/moving-a-translucent-window-around-the-screen#latest
Kf
thanks a lot,seems promising... i will try it out asap. if i understand the whole window is transparent? is there some realtime screen capture in processing? it could be used to correct the eventual blending in selected areas