Delphi Pages Forums

Delphi Pages Forums (
-   General (
-   -   [SOLVED] acucobol bitmap from delphi dll (

FreakaZoid2 08-16-2019 03:57 PM

acucobol bitmap from delphi dll
Ok I have my dll that creates a bitmap but I am trying to figure out how to send it back to acucobol program.
I can modify the dll however it takes. This is the latest changes I have tried.
ACUCOBOL has the ability to load bitmaps but always from a file never from another bitmap or stream or anything like that. cobol then dll code shown.
The background behind this is to never save the signature image to a drive ever.
NOTE: The acucobol library for bitmaps ALL require a file name, so this may not be possible.

01  abitmap                  handle.
    call 'GetMeAbitmap' using
        by reference abitmap


procedure GetMeAbitmap(aStr : PAnsiChar; aHandle : THandle); stdcall;
  wic : TWICImage;
  _bs : TBytesStream;
  _bmp  : TBitmap;
  if not(string(aStr) > '') then
    aHandle := 0;
  wic := TWICImage.Create;
  _bs := TBytesStream.Create(TNetEncoding.Base64.DecodeStringToBytes(String(aStr)));
  _bs.Position := 0;
  _bmp := TBitmap.Create;
  aHandle := _bmp.Handle;

acucobol help guide info

<!-- -->

This routine is a collection of related operations that handle bitmapped (BMP and JPEG) images. Only Windows machines can actually display bitmaps. On all other machines, this routine returns an error code.
<!-- -->Usage


<!-- -->Parameters

<!-- --><TABLE id=BKPPPPLIBRS179__TABLE_4237A5C709CA4F86BBBE751E2 C18372E class=table cellSpacing=0 cellPadding=4 rules=all summary="" border=1 frame=border><TBODY class=tbody><TR class=row><TD class="entry normal" vAlign=top>OP-CODE Numeric parameter </TD><TD class="entry normal" vAlign=top>Selects the W$BITMAP operation to perform. The file acugui.def contains level 78 symbolic names for these operations. Unless otherwise noted, these operations can be used in a thin client environment. The specific operations are described below. </TD></TR><TR class=row><TD class="entry normal" vAlign=top>parameters </TD><TD class="entry normal" vAlign=top>Vary depending on the op-code chosen. </TD></TR><TR class=row><TD class="entry normal" vAlign=top>BITMAP-HANDLE PIC S9(9) COMP-4 (or COMP-5) </TD><TD class="entry normal" vAlign=top>BITMAP-HANDLE holds the return value of W$BITMAP. Values less than or equal to zero indicate errors. If you are loading or destroying ImageLists, this should be a COMP-5 field. </TD></TR></TBODY></TABLE>

<!-- -->Description

W$BITMAP can be used to display a bitmapped image, load a bitmapped image into memory, or remove a bitmapped image and free its memory. You can use this routine to load a bitmapped image into memory as a Windows API data type called an <DFN class=term>ImageList</DFN>, which treats the bitmap file as a series of fixed-width images. This provides a simplified way to load and destroy ImageLists when using the thin client. This routine can be used to capture screen shots of an active window or desktop. This routine can also be used to load IPictureDisp objects.
When it is trying to locate a bitmap file, W$BITMAP will search first for a resource with the specified name, and then for a disk file. Resources are named in a fashion similar to disk files, but without any directory information. (See the COPY RESOURCE statement in <CITE class=cite>ACUCOBOL-GT Reference Manual</CITE> for more information about including resources.)
<!-- -->Note: When you are running in a thin client environment, and a file name beginning with <SAMP class="ph codeph">@[DISPLAY]</SAMP> is passed to this routine, it will attempt to access the file in the display host's file system. It does not download the file from the server. For more information, refer to the topic <CITE class=cite>Using Library Routines and DLLs in Thin Client</CITE>, in the<CITE class=cite> AcuConnect User's Guide. </CITE>
W$BITMAP will examine files to determine the type of image format. If the file suffix is .jpg, .jpe or .jpeg, W$BITMAP assumes the file is a JPEG image. Otherwise, it assumes the files are in BMP format. In order to read JPG files, you must have the file ajpg32.dll installed in the runtime directory. Only 32-bit runtimes support JPEG format images. If you need JPEG support on 64-bit Windows, run the 32-bit runtime or the Thin Client. You can also run the Thin Client with the 64-bit runtime.
W$BITMAP loads 24-bit color or 8-bit grayscale images in the JPEG File Interchange Format (JFIF). It reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPG lossless mode format is not supported.
<!-- -->Note: The behavior of this library routine is affected by the setting of the FILENAME_SPACES configuration variable that may or may not allow spaces in a file name. See the documentation on <CITE class="cite xref-cold">FILENAME_SPACES</CITE> in <CITE class=cite>Appendix H</CITE>.

Parent topic: General Syntax and Library List

<HR class=feedback_footerSep>Send feedback about this topic

All times are GMT. The time now is 02:48 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.