Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Subject: Cameras
Subject: scaleDown command
Subject: black out solved
Subject: Aircraft Tutorial
Subject: Mathematical XYZ ?
Subject: Re: Its done This vs That
Subject: Re: Its done first week
recommendations for screen video captures?
Subject: 3DExplorer "Oddity "
Subject: Re: New Director
Subject: ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
Subject: RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Subject: Re: Texturing
Big Break Contest Videos
Subject: New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Subject: Plasma?
Looking for Inspiration
Subject: Weird EMail Q
Subject: Re: It 's done first week ?
Subject: Cherry not cranberry
Subject: Re: New game
Camera Animation Problem
Subject: Particle plugins?
 
loading members at runtime

loading members at runtime

2004-02-29       - By James Newton

 Back
Reply:     <<     11     12     13     14     15     16     17     18     19  

On 28/2/04 4:02 pm, "noisecrime" <noise@(protected)> wrote:

> there appears to be no way to determine if a bitmap member has an alpha!
> Am I missing a function?
> Haven't tested importfileinto to see if it automatcially sets the usealpha
> property (which member.filename doesn't).

Hi NoiseCrime,

Setting member().fileName maintains the current value of useAlpha, even if
the new bitmap has no alpha channel.  To force the value of useAlpha to
update, you can create a new empty bitmap before you set the fileName:

do "new(#bitmap, member(1))"&RETURN&
  "fileIO = xtra("&QUOTE&"FileIO"&QUOTE&").new()"&RETURN&
  "member(1).fileName = fileIO.displayOpen()"&RETURN&
  "put member(1).useAlpha"

(Remove Return characters before testing).

However, member().importFileInto() does modify useAlpha to suit the imported
file:

do "fileIO = xtra("&QUOTE&"FileIO"&QUOTE&").new()"&RETURN&
  "member(1).importFileInto(fileIO.displayOpen())"&RETURN&
  "put member(1).useAlpha"


Setting the fileName is faster than importFileInto().  On my machine with a
test image, the results were:

 set fileName                      56 ms
 importFileInto                    81 ms

However, the need to recreate a #bitmap with fileName tips the balance
distincly the other way:

 create bitmap, then set fileName 381 ms

So it looks as if the fastest technique would be to assume that, if the
fileName contains ".jpg", then there is no alpha channel.  The safest, fast
technique would be to use importFileInto().


Cheers,

James


PS: I'm only using do() in the above examples to simplify testing ... and
under the mistaken assumption that Colin could not produce the same result
with a single line of code, without using do().

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Dir3d-l mailing list
Dir3d-l@(protected)
http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l