Permalink
Browse files

reading files from testfolder

  • Loading branch information...
1 parent 0e13dce commit be56a196cd729f3b91c32c9786468c5614d3d2af @rkoeppl rkoeppl committed May 5, 2016
Showing with 17 additions and 17 deletions.
  1. +17 −17 modules/printengine.pl
View
@@ -203,28 +203,28 @@
;
die "unknown display software in configuration!\n";
}
-######testcode framebuffer access
- my $fb = Graphics::Framebuffer->new( FB_DEVICE=>$display_device, SPLASH=>0 );
- $fb->clear_screen('OFF');
- $fb->blit_write(
- $fb->load_image(
- {
+#read filelist from testfolder
+ my $dir = '/tmp/tst';
- 'center' => $fb->{'CENTER_XY'},
- # Three centering options are available
- # CENTER_X = center horizontally
- # CENTER_Y = center vertically
- # CENTER_XY = center horizontally and
- # vertically. Placing it
- # right in the middle of
- # the screen.
+ opendir(DIR, $dir) or die $!;
- 'file' => 'test1.png', # Usually needs full path
+ my @pics
+ = grep {
+ m/\.png$/ # png files only
+ && -f "$dir/$_" # and is a file
+ } readdir(DIR);
+ closedir(DIR);
+#builtin framebuffer access
+ my $fb = Graphics::Framebuffer->new( FB_DEVICE=>$display_device, SPLASH=>0 );
+ #$fb->clear_screen('OFF');
+ $fb->blit_write(
+ $fb->load_image(
+ { 'center' => $fb->{'CENTER_XY'},
+ 'file' => '$pics[0]', # Usually needs full path
}
)
);
-sleep 3;
-$fb->clear_screen('OFF');
+#$fb->clear_screen('ON');

0 comments on commit be56a19

Please sign in to comment.