Domino 9 und frühere Versionen > ND6: Entwicklung

Bildverwaltung...

<< < (2/2)

diali:
zu 1.
bei jpg und gif steckt dies im Datei-Header. Allerdings wird die Auflösung eventuell beim einbetten geändert und Du musst Dich mit den Headern der verwendeten Bildtypen auseinandersetzen.

zu 2.
Word kann per COM angesprochen werden. Entweder das Kopieren über die Zwischenablage realisieren oder das Dokument als XML exportieren und dann das Bild im Stream suche und als Datei ablegen. Über die COM-Schnittstelle kann es dann im Word wieder importiert werden.

Schnulli:
Hi zusammen,

danke für die Hinweise.

zu 1.) hm, bin mit der ImageResolution noch nicht wirklich weitergekommen.
Habe mir jetzt einfach im Doc berechnen lassen, wie groß das Bild bei entsprechender dpi-Auflösung werden könnte. Das mit den Headern ist für mich wahrscheinlich zu komplizeirt.
Wer da also noch (einfache) Hinweise hat....

zu 2.) ok, vielen Dank schon mal

Die zwei Lösungen bei OpenNTF sind leider nicht das, was ich suchte.
Die GraphicsDemo.nsf trifft es da schon eher.
Nur leider ist der Import auf nur wenige Dateiformate beschränkt. TIF fehlt zum Beispiel, bräuchte ich aber natürlich.

Jetzt hab ich im Script dazu ein bißchen rumgebastelt, aber erkennt den Imagetype nicht und deshalb kann er kein Preview erstellen.
Geht TIF generell bei Lotus Notes nicht oder liegt es wenn dann am Script? (PNG geht wohl nicht)

Hier mal ein Ausschnitt aus dem Script:

' Open a dialogbox and allow users to select from a list of files
   ' NB: PNG is missing from here as Notes can't import PNG image types.
   files = workspace.OpenFileDialog(True, "File List", "Supported Images|*.jpg;*.bmp;*.tif;*.gif", "C:\") <-hier hab ich einfach das TIF reingebastelt
   If Isempty(files) Then Exit Sub      ' Exit if the user selects the Cancel button
   Forall FileList In files                ' Loop through the list of files selected
      Filename = Filelist            ' Get the current filename
      ' GetImageProperties returns an array of ImageType, height, width and bit-depth
      imgProps = GetImageProperties(Filename)
      ImageType = imgProps(0)      ' Get the image type, BMP-GIF-JPEG-PNG-TIF
      ImageHeight = imgProps(1)   ' Get the image height
      ImageWidth = imgProps(2)   ' Get the image width
      ImageDepth = imgProps(3)   ' Get the image bit-depth

....

' import the same file so we have a preview version.
      Set uidoc = workspace.EditDocument( True, doc )   ' Open the backend doc in the UI
      Call uidoc.GotoField( "ImageView" )                  ' Make the ImageView field the focus
      
      Select Case Imagetype                           ' Select which image type this file is
      Case "GIF":
         Call uidoc.Import("GIF Image",filename)            ' Import the GIF image into the field
         Call uidoc.fieldsettext("ImageType", "GIF Image")   '
-> hier hab ich wieder das TIF reingebastelt:
Set the Image type field
      Case "TIF":
         Call uidoc.Import("TIF Image",filename)            ' Import the TIF image into the field
         Call uidoc.fieldsettext("ImageType", "TIF Image")   ' Set the Image type field
      Case "JPEG":
         Call uidoc.Import("JPEG Image",filename)         ' Import the JPEG image into the field
         Call uidoc.fieldsettext("ImageType", "JPEG Image")   ' Set the Image type field
      Case "PNG":
         ' NB: This will never happen as Notes doesn't import PNG files although it's there if we need it
         Call uidoc.Import("PNG Image",filename)         ' Import the PNG image into the field
         Call uidoc.fieldsettext("ImageType", "PNG Image")   ' Set the Image type field
      Case "BMP":
         Call uidoc.Import("BMP Image",filename)         ' Import the BMP image into the field
         Call uidoc.fieldsettext("ImageType", "BMP Image")   ' Set the Image type field
      End Select


Viele Grüße
Iris

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln