I tried to send an image to a DLL, written in Delphi.
First, in Blitz, I needed to get the ImageBuffer, then lock it (LockBuffer) and then I sent the buffer's handle + 72 to the DLL. The DLL also needed the buffer's width, height and bitdepth (read with GraphicsDepth)
In Delphi, I used this as a pointer to a bytearray. I believe in C++, you need the * sign to do this.
Inside the DLL, I copied the data from the bytearray into an image, I processed it and finally copied the data back into the array.
The speed of the operations depends on what buffer I tried to use (ImageBuffer/BackBuffer/FrontBuffer) and the amount of data I needed to process.
Later on, I tried to use the IDirect3DDevice. I needed the Delphi DirectX7 declarations for it. I sent SystemProperty("Direct3DDevice7") to the DLL, and in Delphi, declared this parameter as a IDirect3DDevice7. Then I could for instance obtain and change it's rendertarget by using Set/GetRenderTarget().
First, in Blitz, I needed to get the ImageBuffer, then lock it (LockBuffer) and then I sent the buffer's handle + 72 to the DLL. The DLL also needed the buffer's width, height and bitdepth (read with GraphicsDepth)
In Delphi, I used this as a pointer to a bytearray. I believe in C++, you need the * sign to do this.
Inside the DLL, I copied the data from the bytearray into an image, I processed it and finally copied the data back into the array.
The speed of the operations depends on what buffer I tried to use (ImageBuffer/BackBuffer/FrontBuffer) and the amount of data I needed to process.
Later on, I tried to use the IDirect3DDevice. I needed the Delphi DirectX7 declarations for it. I sent SystemProperty("Direct3DDevice7") to the DLL, and in Delphi, declared this parameter as a IDirect3DDevice7. Then I could for instance obtain and change it's rendertarget by using Set/GetRenderTarget().