I found an example in Project.rbp.  It shows to
display an image file from a Blob data field you have
to write it to an temporary file before you can
display on the ImageWell.

    if ProductImageWell.Image <> nil then
      
      // FolderItem of the Temporary Image
      f = TemporaryFolder.Child("Order Temp
Image.jpg")
      
      // Save the Image to the File
      f.SaveAsJPEG ProductImageWell.Image
      
      // Read it back in if it exists
      if f.Exists then
        bin = f.OpenAsBinaryFile
        if bin <> nil then
          
          // Read Image 
          imageData = bin.Read(bin.Length)
          bin.Close
        end if
      end if
    end if

Why is it so complecated?

--- Marco Bambini <[EMAIL PROTECTED]> wrote:

> This is a very simple example:
> 
> // create a dummy table
> db.SQLExecute("CREATE TABLE images(picture BLOB)")
> 
> // insert an image into the BLOB column
> Dim rec As New DatabaseRecord
> rec.BlobColumn("picture") = GetMyPicture
> db.InsertRecord ("images", rec)
> db.Commit
> 
> where GetMyPicture is:
> Sub GetMyPicture() As String
> Dim f As FolderItem = GetFolderItem("myimage.jpg")
> Dim s As String
> Dim b As BinaryStream
> 
> b=f.OpenAsBinaryFile(false)
> s=b.Read(b.Length)
> b.Close
> 
> return s
> End Sub
> 
> Hope this can help you.
> ---
> Marco Bambini
> http://www.sqlabs.net
> http://www.sqlabs.net/blog/
> 
> 
> 
> On May 28, 2006, at 6:35 AM, Long Huynh wrote:
> 
> > I look in the example projects downloaded, but
> could
> > NOT find an example how to load an image into
> > REALSQLdatabase table with the field defined as
> BLOB.
> >
> > Coud someone send me an example program.
> >
> > Thanks
> > _______________________________________________
> > 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>
> 

_______________________________________________
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