David Fanning wrote:
> Rick Towler (rtowler@u.washington.edu) writes:
>
>> You didn't really fool around for 20 minutes, did you?
>
> Indeed I did. I thought it might take five. And now
> I've just spent another 15. :-)
>
>> With the B/W linear color table loaded:
>>
>> IDL> test = BYTARR(200,200)
>> IDL> test[100:199,*] = 200
>> IDL> tvlct, r,g,b,/get
>> IDL> write_png,'test.png',test,r,g,b,TRANSPARENT=[0]
>>
>>
>> In PP, Insert -> Picture -> From File... and select 'test.png'
>>
>> I have a 200x200 image, right half is lt. gray, left half is transparent.
>>
>> Load test.png up in Photoshop and the left half of the image is
>> transparent too.
>
> Well, I can see this works. But why doesn't my test
> program work?
>
> PRO TEST
> thisDev = !D.Name
> white = FSC_Color('white', !D.Table_Size-2, Decomposed=0)
> red = FSC_Color('red', !D.Table_Size-3, Decomposed=0)
> green = FSC_Color('green', !D.Table_Size-4, Decomposed=0)
> Set_Plot, 'Z', /Copy
> Erase
> Plot, findgen(11), Color=red, Background=white, /NoData
> Oplot, findgen(11), Color=green
> snapshot = TVRD()
> tvlct, r,g,b,/get
> Set_Plot, thisDev
> write_png,'tester.png',snapshot,r,g,b,TRANSPARENT=[!D.Table_ Size-2]
> Print, !D.Table_Size-2
> I = Where(snapshot EQ !D.Table_Size-2, count) & Print, count
> END
>
> My background (index 254) is white. I want that to be the transparent
> pixel value. There are 304,055 pixels in my image with this value.
> You'd think a *few* of them would be transparent. But no, when
> I put this into Powerpoint, I get an image with a white background.
>
> Any ideas?
>
> Cheers,
>
> David
David,
did you have tried with 24bit or 16bit color resolution.
I believe you have 16bit used.
If it's 16bit then it is the same problem JD postest on 22.5.
I added an other example there.
I recognized this during beta test of idl5.6.
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|