Loading image on form

Noisy_VanNoisy_Van Member Posts: 47
I am attempting to create a form that displays an image (160kb bitmap with our company information). I have created a table with a BLOB field to use as the source, and can use BLOB.IMPORT to import the image from a file. I could import the image from a file when they first open the form. However, we won't know where the file is located. If the file was in the NAV folder, it would be no problem, but then the installer would need to place the bmp in the proper folder, and I'm not sure how easy it would be to find the right folder on the fly. I suppose I could also hardcode the image information and stream it into the BLOB field, but as there is 160k characters, it would be a rather large chunk of code just to accomplish this small task.

So is there any other way to get the BLOB data into the table? Is there a way to export table data along with the table in the FOB file? Or any other simple thing that I'm missing?

Thanks,
Greg

Comments

  • WaldoWaldo Member Posts: 3,412
    I don't exactly know what you try to accomplish here, but what you suggest at the end, is not possible.

    Why isn't it enough to import the image? Or do you just want this image to be present at all times in a new (fresh) database implementation?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Noisy_VanNoisy_Van Member Posts: 47
    Waldo wrote:
    I don't exactly know what you try to accomplish here, but what you suggest at the end, is not possible.

    Why isn't it enough to import the image? Or do you just want this image to be present at all times in a new (fresh) database implementation?

    When the customer installs our customization and imports the FOB file, I want the image to show up on our About form. The only way I could get this to happen was to import the image into a BLOB field in a table. Since exporting tables only exports the definition, they would not have this image, and so our About form image would be blank. I want the image to appear without the step of needing to import it from a file, as we won't necessarily know the path to the file in all cases. So yes, I want the image to be present at all times in a new database implementation.
  • kinekine Member Posts: 12,562
    What about splitting it into smaller bitmaps to be able to use the Image control?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Noisy_VanNoisy_Van Member Posts: 47
    kine wrote:
    What about splitting it into smaller bitmaps to be able to use the Image control?

    Sounds like a fantastic idea. I'll give a try.
  • Noisy_VanNoisy_Van Member Posts: 47
    Worked perfectly, Kamil. Thanks!
  • kinekine Member Posts: 12,562
    You are welcome! 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Noisy_VanNoisy_Van Member Posts: 47
    One more question on this topic: Is it true that the image control is not supported in the RTC? Is there any analogous control that I can use to achieve the same thing I did in the classic client?
  • kinekine Member Posts: 12,562
    It is true, but if you look at some presentations or blog about NAV 2009 SP1 extendability you will see that it is not problem to create own control for that... (e.g. this)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.