Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Using Acrobat on a CD
Importing Externally Linked (sound&bitmap) Files
Macromedia Licensing
Datagrip Net
Drop-Down Boxes in Director
RotateWithSound
Convert between bases-Integer to String
Closing a MIAW
merge sorting including accent marked strings
Popup Score
MediaMacros Xtras Mall
 

 

 

Behavior New bitmap from existing member

Added on 6/12/2000

 

Compatibilities:
D8 Mac PC Script Shockwave

This item has not yet been rated

Author: DaveMennenoh

Creates a new bitmap cast member from a pre-existing bitmap.

--newBmpFromMem (original member, new width, new height, new depth, new member cast position, new member cast name)
--Creates a new bitmap cast member from a pre-existing bitmap.
--origMem - member reference of original bitmap to copy from
--wide - width of new bitmap, if 0 then the width of the original is used
--high - height of new bitmap, if 0 then the heoght of the original is used
--deep - colordepth of the new bitmap, if 0 then 32 is used, if #grayscale is used a new 8 bit grayscale version of the original is created
--newMem - number of the new castmember to create. If 0 then 1st available empty cast slot is used
--cName - name of castLib to place new bitmap into. If "" then internal is used
--returns 1 if successfull, 0 otherwise.
--Director 8 image manipulation routines.
--(c) 2000, Dave Mennenoh
--dmennenoh@hotmail.com

--newBmpFromMem (original member, new width, new height, new depth, new member cast position, new member cast name)

--Creates a new bitmap cast member from a pre-existing bitmap.
--origMem - member reference of original bitmap to copy from
--wide - width of new bitmap, if 0 then the width of the original is used
--high - height of new bitmap, if 0 then the heoght of the original is used
--deep - colordepth of the new bitmap, if 0 then 32 is used, if #grayscale is used a new 8 bit grayscale version of the original is created
--newMem - number of the new castmember to create. If 0 then 1st available empty cast slot is used
--cName - name of castLib to place new bitmap into. If "" then internal is used

--returns 1 if successfull, 0 otherwise.
on newBmpFromMem origMem,wide,high,deep,newMem,cName
  typ=origMem.type
  okTyp=[#bitmap,#text,#vectorShape]
  if getPos(okTyp,typ) then
    
    if not wide then wide=origMem.width
    if not high then high=origMem.height
    gFlag=0
    if deep=#grayScale then
      deep=8
      gFlag=1
    end if
    if not deep then deep=32
    if cName="" then cName="internal"
    
    if gFlag then
      newIm=image(wide,high,deep,#grayScale)
    else
      newIm=image(wide,high,deep)
    end if
    
    newIm.copyPixels(origMem.image,rect(0,0,wide,high),origMem.rect)
    
    if newMem then
      nM=member(new(#bitmap,member newMem,castLib cName))
    else
      nM=member(new(#bitmap,castLib cName))
    end if
    
    nM.image=newIm
    return 1
  else
    return 0 --wrong type of member specified in origMem
  end if
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail