Python Forum
VBScript LoadPicture() alternative within Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VBScript LoadPicture() alternative within Python
#1
Hi All,

We are migrating VBScripts to Python scripts.
We hosts ActiveX controls in our applications, and interact with hosted ActiveX controls via executing VBScripts within VBScript ActiveX scripting engine at runtime. We are using pywin32 package to load this as ActiveX scripting engine and execute the python scripts to at runtime to work with ActiveX controls.

Most of the migration is going smooth, and got stuck with - LoadPicture() method that returns IPictureDisp object type.
VBScript Code snippet to convert into Python:
ImageList1.ListImages.Add 1,,LoadPicture("test.bmp")

The VBScript LoadPicture function is used to return a picture object that is loaded from a file, the LoadPicture syntax is:
LoadPicture (filename)

Didn't find any alternative for LoadPicture() method in Python, or a way to convert Image (Image.open() - Python PIL package) object type to IPictureDisp type.

I've tried multiple Image Processing libraries in Python but no luck.

Thank you for your help in advance.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  alternative to using request module in python vlearner 2 1,966 Feb-05-2022, 09:35 AM
Last Post: ibreeden
  Python alternative to R "Imager" kimrants 2 4,068 May-16-2018, 08:53 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020