Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Interesting problem with image alpha data
Date: Tue, 18 May 2010 17:01:24 +0000 (UTC)
Organization: Princeton University
Lines: 28
Message-ID: <hsuh54$t1i$1@fred.mathworks.com>
References: <h1fj4i$7ln$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1274202084 29746 172.30.248.37 (18 May 2010 17:01:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 May 2010 17:01:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1984263
Xref: news.mathworks.com comp.soft-sys.matlab:636943

"Michael " <michael.bennett@lineone.net> wrote in message <h1fj4i$7ln$1@fred.mathworks.com>...
>  I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.
> 
>  To explain, consider the following example:
> 
>  h1 = figure(1);
>  h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);
>  h1b = image('Parent', h1a);
> 
>  All works as expect, then:
> 
>  set(h1b, 'CData', imread('Peppers.png'));  % load a test image.
> 
>  This works just as would be expected.  So, I then try:
> 
>  set(h1b, 'AlphaData', 0.75);
> 
>  Which has the right effect.  However, this image isn't positioned very nicely within the axes, so I use:
> 
>  set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');
> 
>  Which makes everything look nice.  But now if I set the alpha data to anything other than 1, the image just dissappears completely.  Can anyone tell me what is going wrong here?
> 
>  I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.
> 
>  Many thanks!

I had a very similar problem and it turned out to be a bug with OpenGL. I tried it on another computer and it just worked! Right now I am trying to update my OpenGL driver.