Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
ScreenShot code
-
Are there any avialable with the Pythonista modules able to write a screen dump to an image during run time ?
-
I think no :-( I was interested also....
-
If it were possible you would only be able to take a screenshot within Pythonista. My guess is you probably want a screenshot of another app?
I think you could manually take a screenshot of another app, then copy if off of your clipboard for processing with Pythonista... Not sure how though.
-
The thing I was looking for was a way to build a picture in the Scene Setup and then use this as a regular image later on in draw.
I know this can be done with a PIL image directly, but the drawing of especially circles and arcs has no anti aliasing and therefore looks ugly.So my idea was to build the whole image from drawing elements and then screen shot it to an image. The app would blink at startup, I think, but that is not a problem.
Building the image before run is not an option since there will be changes from time to time when the app is launched.Re Peter
-
You do know about the standard iOS screenshot by pressing the home button and the power button simultaneously?
-
To clarify why I wants to take a screenshot or draw into a context, please consider the following code
from scene import * from PIL import Image, ImageDraw class MyScene (Scene): def setup(self): img = Image.new("RGBA", (300,300)) draw = ImageDraw.Draw(img) draw.ellipse((0,0,200,200),fill=(255,255,255,255)) del draw self.imageName = load_pil_image(img) def draw(self): background(0.09,0.09,0.102) image(self.imageName,200,300,300,300) fill(1,1,1,1) no_stroke() ellipse(500,400,200,200) run(MyScene(), LANDSCAPE)
There is a clearly visible difference between the two circles.
What I am aiming for is to predefine a number of pictures in Setup and then use those in Draw.
The pictures are complicated and I think it would be to expencive to FPS to draw all the elements they contain (text, multiple lines, circles, gradients and so on) in every Draw loop.
An option would be to make the images by forehand but since the user will need to change details, this is not an option.
So I was thinking on setting up the whole 1024x768 backgrund picture in Setup and every time the user specifies changes.Hope this clarifies a little ccc as a reply to you pm.
Thanks Peter
-
backgroundSwap.py https://gist.github.com/cclauss/7132028
Create three background images in scene.setup() then in scene.draw() use the x coordinate of the user's drag location to determine which background image to display. The grey dot represents foreground drawing that takes place on top of one of three different backgrounds. This method could be used for example to make a multilevel game where the graphics for each level were drawn up front and stored in PIL images. The foreground would then be drawn on top of the background of the current level in the scene.draw() method.