I tried to use that

  Dim f as folderItem
  Dim p as Picture
  Dim fName as String

  fName = "ADVCTMP1.PICT"


  If fName<>"" then
    f = getFolderItem(fName)   // this'll attempt to create a
    // folderItem ref in the same folder
    // as your app
    If f <> Nil then
      f.saveaspicture(p)
    End If
  End if




  // Reset Variables
  fName=""
  f=nil
  pic=nil
  // Clear Canvas1
  Canvas1.Graphics.ClearRect 0, 0, Canvas1.width, Canvas1.height
  Canvas1.Backdrop = pic
  // Set PIC as a NEW Picture
  pic=New Picture(graphics.width, graphics.height, 32)

  But I got a NilObjectException on f.saveasPicture(p)
and I was confused a bit when looking at the code
all I want to do is save a picture in a file that would only be used temporarily


Brian Heibert
[EMAIL PROTECTED]


On May 4, 2006, at 9:48 AM, Michael Rebar wrote:

On 5/3/06 7:27 PM, "Brian Heibert" <[EMAIL PROTECTED]> wrote:


******** SEE BELOW
 Dim dlg as New SaveAsDialog
 // Check to see if Filename has been created
 If fName="" then
   // Filename has NOT been created so goto SAVE AS
   dlg.Filter="image/jpg, bmp, pict, gif"
   dlg.SuggestedFileName=fName
   dlg.Title="Save Drawing"
   f=dlg.ShowModal()
   If f <> Nil then
     f.saveaspicture(pic)
     fName=f.name
   Else
     //user canceled
   End If
   // Filename has been created so continue to SAVE
 ElseIf fName<>"" then
   f.name=fName
   If f <> Nil then
     f.saveaspicture(pic)
   End If
 End if


******** SEE BELOW
  Dim f as folderItem
  Dim p as Picture
  Dim fName as String

  fName = efPictureName.text
  p = somePictureName

  If fName<>"" then
    f = getFolderItem(fName)   // this'll attempt to create a
    // folderItem ref in the same folder
    // as your app
    If f <> Nil then
      f.saveaspicture(somePictureName)
    End If
  End if


Brian Heibert
[EMAIL PROTECTED]


_______________________________________________
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>


_______________________________________________
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