Sean,

WOW! all that to just show a PICT image on a Windows system?

Thanks for all your help as I had someone tell me that my MaskIt! program did not read PICT files in Windows, and he's right. So I thought I find out why. I have QuickTime installed and if you click on the PICT file, QT will open it but it will not in my application.

I found out that one can COPY the image in QuickTime then open MS Paint and paste it in there and then Save As... BMP or JPG.

I wanted it to do it in my app but I am not sure if it is possible.

Thanks still for all your help,

Jonathon
RB2005r4 Pro WinXP

----- Original Message ----- From: "Sean Arney" <[EMAIL PROTECTED]>
To: "RB Getting Started" <[email protected]>
Sent: Thursday, January 26, 2006 7:23 PM
Subject: Re: Viewing PICT on a Windows system


Woops, hit the send key...like this:

 If localGrp = Nil And localPic <> Nil Then
   sg = ScalePicture( localPic, Me.Width - 15 , Me.Height - 15 )
   g.PenWidth = Me.Width/72
   g.Penheight = Me.Height/72
   sg.Transparent = 1
   g.UseOldRenderer = True
   g.DrawPicture sg, Me.Width- sg.Width, Me.Height-sg.Height
   Me.localPic = sg
 Else
   If localGrp <> Nil then
     osc = localGrp.Scale
     bdr = 30
     cw = Me.Width - bdr
     ch = Me.Height - bdr
     pw = picw
     ph = pich
     sc = Min( cw/pw, ch/ph )
     scpw = sc*pw
     scph = sc*ph
     picx = ( (cw-scpw)+(bdr/2) )/2
     picy = (( (ch-scph)+(bdr/2) )/2)+bdr/2
     If sc <> osc Then
       localGrp.Scale = sc
       result = locBBox.Get( Me, localGrp, g )
     End If
     g.UseOldRenderer = True
     g.Bold = true
     g.PenWidth = 1
     g.DrawObject( localGrp, picx, picy )
   End If
 End If

Now both these use a picture, depending on whether there is vector info
available or not.  So if the localGrp is Nil, then it knows that its a
raster and uses localPic. It does scale them both, vector side with a bbox method to get it in the right place and they both do show on windows, but as
I said, the Win version is raster no matter what coming through the Qtime
stuff.

Maybe its due to OldRenderer?  Also freaky is that OldRenderer is waaaay
faster for displaying the vector stuff when supposedly Quartz handles this
better - go figure.

ScalePicture does this (I got it from a kind soul on the list):

 // Scales a picture to fit into given constraints.
 // If maxWidth or maxHeight are zero, the original size is assumed.

 dim dest as Picture
 dim targetWidth, targetHeight as integer
 dim ScaleWidth, ScaleHeight, OverallScale as Double

 // If argumets are misssing, bail out.
 if (src=nil) or ((maxWidth=0) and (MaxHeight=0)) then
   return nil
 end if

 // Calculate the horizontal and vertical scale
 if maxWidth>0 then
   ScaleWidth = maxWidth*2/src.Width
 else
   ScaleWidth = 1
 End If
 if MaxHeight > 0 then
   ScaleHeight = MaxHeight*2 / src.Height
 else
   ScaleHeight = 1
 end if

 // Use the lower of the both scales, to preserve aspect ratio
 OverallScale = Min(ScaleWidth, ScaleHeight)

 // Calculate new picture size
 TargetWidth = src.Width * OverallScale/2
 TargetHeight = src.Height * OverallScale/2

 // Create new picture
 dest = NewPicture(TargetWidth, TargetHeight, 8)

 // Draw the source picture scaled into the new one
 dest.Graphics.UseOldRenderer = True
 dest.Graphics.DrawPicture src, 0, 0, TargetWidth, TargetHeight, 0,
0,src.Width, src.Height

 return dest

HTH,

-seanA


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 1/24/2006





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 1/24/2006

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to