Announcement

Collapse
No announcement yet.

Embed Image in DDOC from SQLitening

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21

    > I am getting a bit confused yet again, just when I thought I was geting a hang of it.

    $TempImageFile is only needed because dpAddGraphic loads jpg/jpeg files and the file is a string in a column in SQLite.
    Note: dpAddGraphic can load the original jpg file if its name and location are saved in a table and not use $TempImageFile.

    Folder(s) with unique jpg file names could be used instead of saving the files into the table.
    This would require an index to all the names and locations. Individual files would take much more space.

    A single flat file with all the images could also be used, but the start byte and length of each file is needed
    and then would have to be saved to another file to be loaded by dpAddGraphic so it is more work with the save result.

    The current way used is fine, but saving a string to disk then reloading as a jpg might be done better by an image expert
    to use something like dpAddGraphicString(MyString$) instead of dpAddGraphic(jpgfile)

    Comment


    • #22
      Hello Mike,

      I did not initially see this line before I posted:

      Code:
      slPutFile $TempImageFile,slf(5), "C"
      and where you placed it, explains it all to me. Thank you for your time and for bailing me out. My program works fine now.
      Fredrick Ughimi
      www.meganetsoft.com

      Comment


      • #23
        Repealed and replaced $TempImageFile with unique file sTempImageFile$ in case multiple callers at the same time
        Code:
        FUNCTION ReportCertificate AS LONG
         LOCAL sTempImageFile AS STRING 'change 1
         DO WHILE slGetRow()
          sTempImageFile=GUIDTXT$(GUID$) + ".jpg"    'change 2
          slPutFile sTempImageFile,slf(5), "C"  '5th column    'change 3
          hpix = dpAddGraphic(ihandle%, sTempImageFile+$NUL) ' change 4
          KILL sTempImageFile  'change 5

        Comment


        • #24
          Hello Mike,

          Repealed and replaced $TempImageFile with unique file sTempImageFile$ in case multiple callers at the same time
          Would try that out and see how it goes. Thanks alot.

          Best regards,
          Fredrick Ughimi
          www.meganetsoft.com

          Comment


          • #25
            Hello Mike,

            Code:
            FUNCTION ReportCertificate AS LONG 
              LOCAL sTempImageFile AS STRING 'change 1  DO WHILE slGetRow()   sTempImageFile=GUIDTXT$(GUID$) + ".jpg"    'change 2   slPutFile sTempImageFile,slf(5), "C"  '5th column    'change 3   hpix = dpAddGraphic(ihandle%, sTempImageFile+$NUL) ' change 4   KILL sTempImageFile  'change 5
            This worked nicely as well. Thanks a bunch.
            Fredrick Ughimi
            www.meganetsoft.com

            Comment

            Working...
            X