summaryrefslogtreecommitdiff
path: root/lib/App/VRR
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-08-28 21:51:51 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-08-28 21:51:51 +0200
commitc69fc4e88af0bfe12c9b4f589309a6e12e5fefc9 (patch)
treed49832b734291e42a0120e03fb4e45f03c2b9480 /lib/App/VRR
parent9bea66807af13b3ddc2cf9a1b8a5e9b1d58e9abb (diff)
specify negative no_lines to autocrop png (remove black space)
Diffstat (limited to 'lib/App/VRR')
-rw-r--r--lib/App/VRR/Fakedisplay.pm.PL17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/App/VRR/Fakedisplay.pm.PL b/lib/App/VRR/Fakedisplay.pm.PL
index d051f2c..7969bde 100644
--- a/lib/App/VRR/Fakedisplay.pm.PL
+++ b/lib/App/VRR/Fakedisplay.pm.PL
@@ -169,6 +169,23 @@ sub new_line {
return;
}
+sub crop_to_content {
+ my ($self) = @_;
+
+ my $new_im = GD::Image->new($self->{width} * $self->{scale},
+ $self->{offset_y} * $self->{scale}, 1);
+ $new_im->copyResized($self->{image}, 0, 0, 0, 0,
+ $self->{width} * $self->{scale},
+ $self->{offset_y} * $self->{scale},
+ $self->{width} * $self->{scale},
+ $self->{offset_y} * $self->{scale}
+ );
+
+ $self->{image} = $new_im;
+
+ return;
+}
+
sub png {
my ($self) = @_;