On 2010-11-29 09:24, Chameen De Silva wrote:
Im doing an extension for OO writer. In my application a dialogbox is set to
appear and now I need to embed an animated .gif image in to that dialog box.

Can some one help me with that.
Thanx in advance


I have a StarBasic extension that shows an about-dialog with an image from the extension bundle using roughly this code:

   Sub ShowAboutDialog
      Dim Dlg as Variant

      DialogLibraries.LoadLibrary("MyLibrary")
      Dlg = CreateUnoDialog(DialogLibraries.MyLibrary.AboutDialog)

      On Error Resume Next

      Dim InfoProvider as Variant
      InfoProvider =
   
GetDefaultContext().GetByName("/singletons/com.sun.star.deployment.PackageInformationProvider")

      Dim BaseUrl as String
      BaseUrl = InfoProvider.GetPackageLocation(MY_PACKAGE_NAME)
      BaseUrl = BaseUrl & "/graphics/"

      Dlg.GetControl("MyLogoImage").Model.ImageURL = BaseUrl &
   "my-logo.png"

      On Error Goto 0

      Dlg.Execute
      Exit Sub

   End Sub


MY_PACKAGE_NAME will be something like "com.mycompany.mylibrary.ooocalc".

The dialog has an ImageControl named "MyLogoImage". The .png file is in a graphics/ directory that is just added to the .oxt (.zip) archive with 7-zip (or you can use regular WinZip etc.). I haven't done anything to register the graphics files in the manifest or elsewhere; perhaps that's slightly naughty but it works for me :-).

Hope this can inspire you.

Cheers
-- Jan Holst Jensen, Denmark

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to