AAC-Pvoice

 view release on metacpan or  search on metacpan

lib/AAC/Pvoice/Bitmap.pm  view on Meta::CPAN

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
        {
            $tmpdc->SetTextBackground($bg);
            $tmpdc->SetTextForeground(wxBLACK);
            $tmpdc->SetFont($cfont);
            $tmpdc->DrawText($caption, int(($x-$cw)/2),$y-$ch);
        }
        my $tmpfile = File::Temp::tmpnam();
        $newbmp->SaveFile($tmpfile, wxBITMAP_TYPE_PNG);
        local $/ = undef;
        open(my $fh, "<$tmpfile");
        binmode($fh);
        my $image = <$fh>;
        close($fh);
        $cache->set("$file-$x-$y-$caption-$ibg-$blowup-$pbg-$mtime", $image);       
    }
     
    my $fh = IO::Scalar->new(\$image);       
 
    my $contenttype = 'image/png';
    return Wx::Bitmap->new(Wx::Image->newStreamMIME($fh$contenttype))
}



( run in 0.234 second using v1.01-cache-2.11-cpan-8d75d55dd25 )