Quote Originally Posted by tnguyen View Post
Thanks Ivan. The attachment source works well. As you said, it only works with small image.
In cDbImageContainer.pkg (subdir: imagen\Graphics17) replace the Read_Data method with this one :

Code:
    Procedure Read_Data
        Integer iDataFile iDataField ichannel isize iarg itype
        String sValue
        
        Get Data_File to iDataFile
        Get Data_Field to iDataField
        
        If (iDataFile <> 0 and iDataField <> 0) Begin
            Get_Attribute DF_FIELD_TYPE of iDataFile iDataField to itype
            If (itype=DF_TEXT or itype=DF_BINARY) Begin
               Move (Seq_New_Channel()) to ichannel
               Direct_Input channel ichannel ("dbms: binary: "+String(iDataFile)+", "+String(iDataField))
               Get_Channel_Size ichannel to isize
               Close_Input channel ichannel
               Send Seq_Release_Channel ichannel
               Get_Argument_Size to iarg
               If (isize>iarg) Set_Argument_Size (isize+100)
            End
            Get_Field_Value iDataFile iDataField to sValue
            If (pbLoadFromString(Self)) Set psImage to sValue
            Else Set psImage to (Trim(sValue))
        End
    End_Procedure
It can read image from any size... the problem is the memory usage.

best regards
Ivan