logo       

Re: Creating a BMP from scalar...: msg#00023

Subject: Re: Creating a BMP from scalar...
On Sun, 17 Sep 2006 21:58:56 -0700
"Bradley K. Embree" <bke@xxxxxxxxx> wrote:

  Hi,

> I have a scalar containing a bmp (generated by ChartDirector 
> (http://www.advsofteng.com/cdperl.html)) that I would like to create a 
> Wx::Bitmap from, which I will then draw on a panel.
> 
> Wx::Bitmap does not seem to be able to do this directly, but I thought I 
> could create a Wx::Bitmap from a Wx::Image.

  Correct.
 
> open my $fh, '<', \$chart_bmp or die "cannot open: $!";
> $bmp = Wx::Bitmap->new(
>       Wx::Image->new( $fh, wxBITMAP_TYPE_BMP, -1 )
> );
> 
> Which gives me an error of 'DIB Header: Image width > 32767 pixels for 
> file.'.

  This should work, though. I will have a look at it.
Which wxPerl/wxWidgets versions and platform are you using?
 
> I've tested the contents of $chart_bmp by opening a filehandle and 
> printing the contents to the file and it is a valid bitmap. So I am a 
> bit lost as far as where to go next.
> 
> Is it possible to create a stream from a scalar? I've looked at 
> wxInputStream but the docs indicate that it is not implemented in wxPerl.

  Perl strams should be transparently wrapped into wxInputStreams.

Regards
Mattia

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe