Highlighted
Absent Member.
Absent Member.
2853 views

[archive] Picture loading into ActiceX

[Migrated content. Thread originally posted on 18 February 2004]

I want to load a bitmap into an ActiveX control. In a VB example the code is:

AxCntrl.TypePictPicture = LoadPicture("C:\Samples\Files\CARD.BMP")

How would I do this in COBOL as I am not sure what I use to substitue VB's LoadPicture function?

Thanks
0 Likes
12 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

My last attempt to do this was unsuccessful due to that procedure being a VB only procedure. However, if the control supports Image Lists, AcuCobol now provides a function of W$BITMAP that will load the image list and return a handle that can be passed to the active-x control.

I've been able to do this with a couple of different controls that support image lists. Let me know if you have any other questions.

Regards,
Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

FYI, it is planned an ACUCOBOL-GT counterpart of the vb LoadPicture function for a future release.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Thank you Robstan. I have asked the question to the supplier of my activex control.

Thank you Gisle, it would be good to know what kind of priority has been placed to the LoadPicture equivalent function.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Gisle,

That would be wonderful! I'm interested in that functionality as well!

Thanks,
Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Rob,

Have heard back from my supplier and they say....

"If you can load a picture into an image control you could try
ss.typepictpicture = image1.picture"

Any idea how I can create and use an image control in AcuCobol?

SR
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

SR,

Unfortunately, I don't know if or how to do that... Maybe someone else will have some comments?

Good Luck!

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

First of all. LoadPicture is coming, that is all I want to say about that. To rush this, you have to check out with your Acu contact.

As for the imagelist, there are two kinds of imagelists, one is a storage, e.g. ImageList handle. The other is the ImageList object.
Confused? I promise you I was.
These two, are not compatible. The WBITMAP-LOAD-IMAGELIST produces a handle to the physical storage imagelist, what most components ask for is the object imagelist.

To tell what you have, you have to look into your components definition file. If their property/method is expecting a dispatch pointer, they are expecting the object variant. If they are expecting a handle (LONG or something), they are expecting the storage.

Finally, I believe it is possible to load an IPicture (which this really is about) from an API function from plain ACUCOBOL, I just haven't worked on it yet. In short term, this is certainly the best approach, but remains to be done. I will see what I can get by.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Thanks for the insight Gisle. I wasn't aware of that about the differences in the image list stuff. I guess I was lucky that the controls I'm using have been looking for the type that W$BITMAP supports. This information will help ensure that I don't assume that all image lists will work.

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Yes, thank you Gisle for that explanation.

Just to be sure how to recognise despatch pointers from handles I have the following GET and PUT property defined in the components definition file. Is this what a despatch pointer looks like or is this still a handle?

* TypePictPicture
* Sets or returns the picture displayed in a picture cell.
PROPERTY-GET, 178, @TypePictPicture RETURNING "Picture*", TYPE 9

* TypePictPicture
* Sets or returns the picture displayed in a picture cell.
PROPERTY-PUT, 178, @TypePictPicture, "Picture* (Property Value)", TYPE 9

SR
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Originally posted by SRFish
Is this what a despatch pointer looks like or is this still a handle?

      * TypePictPicture
      * Sets or returns the picture displayed in a picture cell.
               PROPERTY-GET, 178, @TypePictPicture                 RETURNING "Picture*", TYPE 9

SR


When you see a property or a method returning or expecting a TYPE 9, it is a dispatch pointer.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Picture loading into ActiceX

Gisle, thank you for that confirmation.

1) Is there a list of meanings to "TYPE x" that I could have?

2) Would you please look into IPicture for me?

Originally posted by gforseth
I believe it is possible to load an IPicture (which this really is about) from an API function from plain ACUCOBOL


Your help is very much appreciated.

Thanks again
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.