From: Carlos on
"Michael " <michael.bennett(a)lineone.net> wrote in message <h1fj4i$7ln$1(a)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.
From: Rene v B on
Worked out for me:
rotate the picture a little bit...


"Michael " <michael.bennett(a)lineone.net> wrote in message <h1fj4i$7ln$1(a)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!
 | 
Pages: 1
Prev: fmincon
Next: Copula pdf and copula cdf