Python Programming for Raspberry Pi, Sams Teach Yourself in 24 Hours
TABLE 23.1 Picture Quality Definitions You may have noticed that dots per inch (dpi) is not mentioned in the definitions in Tabl ...
FIGURE 23.1 A low-resolution image. In Figure 23.1, you can see that the Image Viewer’s title bar shows the resolution of the im ...
The photograph’s resolution is 5616×3744, as you can see in the Image Viewer’s title bar. Its resolution makes this still photo ...
to be used for your HD images. Finding the Images Now that you have your presentation screen set up, you need to find your image ...
Also, you use the .blit operation to put the picture on the screen. Finally, the pygame.display.update operation causes all the ...
FIGURE 23.3 File Manager, showing a removable hard drive. Look at the File Manager address bar for the directory that contains ...
name of the removable drive’s device file. The first clue is to look for the name of directory you recorded in step 3. In this e ...
os.system(Command) Remember that the PictureDirectory variable was set earlier to /home/pi/pictures. The files on the removable ...
as shown here: Click here to view code image PrezScreenSize = PrezScreen.get_size() Scale=PrezScreenSize Within your picture dis ...
the screen’s background color surrounding it. FIGURE 23.6 A “framed” photo. Note that if you have photos of different sizes, the ...
FIGURE 23.7 An uncentered photo. To properly center your images, you need to add an additional variable to the place where the d ...
Click here to view code image #script2301.py - HD Presentation #Written by Blum and Bresnahan # ################################ ...
#Display HD Images to Screen ################# PrezScreen.fill(ScreenColor) PrezScreen.blit(Picture,PictureLocation) pygame.disp ...
the necessary modifications to your script. TABLE 23.2 Functions Used in Loaded Modules To load only the functions you use from ...
Avoiding Converting Images In Hour 19, you learned that for games, it is wise to use the .convert_alpha() operation to load imag ...
# Font # # DefaultFont='/usr/share/fonts/truetype/freefont/FreeSans.ttf' PrezFont=font.Font(DefaultFont,60) # # Text # # IntroTe ...
immediately loading when you click the mouse. If you just want to show your friends and neighbors vacation pictures, you can lea ...
# PrezScreenSize = PrezScreen.get_size() Scale=PrezScreenSize[0]-20,PrezScreenSize[1]-20 # ###### Run the Presentation ######### ...
Feel free to add as many changes as you desire. This is your HD image presentation script! Playing Music You can use Python to c ...
and then stops. By-the-Way: Queuing It Up! If you want to play only a couple songs, you can use the queue method. You simply loa ...
«
17
18
19
20
21
22
23
24
25
26
»
Free download pdf