[futurebasic] Re: [FB] Need a FN ShowPict

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2005 : Group Archive : Group : All Groups

From: Steve Crossman <mactech@...>
Date: Mon, 14 Nov 2005 19:04:41 -0500
i use the two routines below to place any QuickTime compatible image  
anywhere on the screen.
there is some deprecated call in there, but they will function just  
fine.

local fn CustomImageFileToPict(pSpec as ^FSSpec, r as ^Rect) // r  is  
ptr to rect
dim as handle @myPict
dim as GraphicsImportComponent  @grphImpComp
dim as ComponentResult          crslt
dim mySpec as FSSpec
dim as OSErr err
myPict = 0
mySpec = pSpec

long if fn GetGraphicsImporterForFile(mySpec, grphImpComp) = _noErr
crslt = fn GraphicsImportGetBoundsRect(grphImpComp, #r)
OffsetRect(#r,-r.left%,-r.top%) // Set to 0,0 : t,l for later ease
crslt = fn GraphicsImportGetAsPicture(grphImpComp,myPict) // actual  
image
err   = fn CloseComponent(grphImpComp)
End if

End fn  = myPict

local fn get_image_file(whereX,whereY, fName as STR255, wdRefNum as  
short )
DIM @myPict as Handle
DIM mySpec as FSSpec
DIM theRect as Rect
dim err as OSerr
// convert wdRefNum to a file system spec (FSSpec)
err = fn WDRefNumToFSSpec( fName, wdRefNum, mySpec )

long if fName <> "" AND err = 0
myPict = fn CustomImageFileToPict(mySpec,theRect)
xelse
myPict = 0
End if

End fn = myPict

On Nov 14, 2005, at 6:48 PM, Stu Cram wrote:

> Check your manual and HELP files again.
> There is a powerful set of routines to get and show many types of  
> picture files.
> Two of them are
> 	DEF DRAWIMAGEFILE     and
> 	USR IMAGEFILETOPICT
> are two useful routines available in "Subs Image Files.INCL" by Staz.
>
> - Stu
>
>
> On Nov 14, 2005, at 4:58 PM, Brian Heibert wrote:
>
>> I have a thought maybe a suggestion for Staz
>> Sorry for bringing up RB
>>
>> REALbasic can use picture files PICT or BMP
>> instead of PICT resources
>> maybe add a way to add a picture file to the project window
>> and find a way to access that picture and put it in a picture field
>>
>> Brian
>
> --
>