Highlighted
Absent Member.
Absent Member.
1869 views

[archive] ActiveX-control for scaling bitmap?

[Migrated content. Thread originally posted on 01 July 2003]

I'm looking for an activex-control that easily scales (stretches etc.)bitmaps on the screen. That is I want to be able to scale images of different sizes to a fixed one on the screen, sort of like the WINPRINT-PRINT-BITMAP option does when printing, only i want to do it on the screen. Any suggestions?
0 Likes
8 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

You should be able to use Visual Basic to create an ActiveX control which can use the image control which has a Stretch property.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

Ok, you got me curious, so I created an ActiveX control in VB that uses the VB image control which can stretch/shrink a displayed image. Attached is a sample cobol program with source, and VB project and ocx. Hope this helps.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

Hi DanM,
it's a very cool program!


thx
Luca

🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

DanM,

1. If I user your control, compiling it with V6.1, everything is ok, but when I compile with V6.2, the control doesn't show.

I seem to have the same problem with MSCAL.OCX.

Any Ideas ?

2. If you have time to spare. Could you make the control in this way we can put other controls upon it like edit-fields and so on.
Maybe even put a gradient property.

Regards
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

Originally posted by Hans
1. If I user your control, compiling it with V6.1, everything is ok, but when I compile with V6.2, the control doesn't show.

I seem to have the same problem with MSCAL.OCX.

Any Ideas ?


Are you using a resource? Please try remove the resource reference and see if it works then.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

Hans,
Using this control for a window background just wouldn't work correctly with acucobol and I'm sure I would run into limitations trying to make it work.
I think perhaps a better solution is using win32 API calls to load an image and display on the window. Doing this is not trivial and requires many api calls to make it work such as getting the active windows compatable Device Context, a client rectangle, loading a bitmap, putting it into the DC, all the cleanup, etc, etc. Gradients can also be done in a similiar way. Again though, there may be limiatations when it comes to repainting the image when the acucobol window client area is repainted. Proper Window event handling might have to be looked at. I have not tried any of this in acucobol, but I have seen samples in Visual Basic, FoxPro, C and C++, all of which, expectadly so, do things differently from Acucobol. I do plan on attempting an acucobol sample soon.
Of course, the most convenient solution would be for acucorp to provide us with an acucobol Window Picture and Gradient property and do the API heavy lifting for us. But I doubt this would be high on their priority list.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

Hey guys, would you be so kind for define "gradient"
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ActiveX-control for scaling bitmap?

Gisle,
We are using gradient to mean a background color effect for a window that uses two colors which are gradually transitioned in either a vertical or horizontal direction based on the dimensions of the window.
Examples:
http://www.codeproject.com/gdi/grad01.asp
http://www.codeproject.com/gdi/win32_gradients.asp

It's a very nice visual effect, but not often used.

Tutorials for drawing on a window:
http://www.codeproject.com/gdi/
http://www.codeproject.com/gdi/Paint_beginner.asp
http://www.codeproject.com/gdi/updatergn.asp
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.