Search the Community
Showing results for tags 'delphi4python'.
Found 2 results
-
Hi all, I'm using DelphiVCL + PyScripter to develop a Python windows application.I've created and "pyd" extension module in which perform some critical time operations or add support functions missing in DelphiVCL. - In python script I create an Image - now I would like to send a bytes array to cnc_vision_ext module (made with Delphi): import delphivcl import cnc_vision_ext as ext .... my_Image = delphivcl.Image(Form1) ext.update_image_from_bytes(my_image, 1024, 768, 3) Now in the wrapper CncVisionUpdateImageFromBytesArray_Wrapper I need to extract the TImage instance contained in PPyObject of args. I was not able to find the right way.... { generic functions wrappers } function CncVisionUpdateImageFromBytesArray_Wrapper(pself, args: PPyObject): PPyObject; cdecl; var Image: TImage; Width: Integer; Height: Integer; Channels: Integer; Bytes: TByteArray; ImagePyObj: PPyObject; begin with GetPythonEngine do begin if PyArg_ParseTuple(args, 'Oiii:update_image_from_bytes', @ImagePyObj, @Width, @Height, @Channels) <> 0 then begin // ??? HOW TO GET BACK wrapped TImage from Image() object created with my_image = delphivcl.Image(owner) ??? Image := TImage((PythonToDelphi(ImagePyObj) as TPyDelphiObject).DelphiObject); Result := PyUnicodeFromString ( Format('%s %d %d %d', [Image.Name, Width, Height, Channels]) ); end else Result := nil; end; end; { TPyExtensionManager } procedure TPyExtensionManager.WrapperInitializationEvent(Sender: TObject); begin FWrapper.RegisterDelphiWrapper(TPyCncVisionVideoCapturePxc_Wrapper); FWrapper.RegisterFunction ( PAnsiChar('update_image_from_bytes'), CncVisionUpdateImageFromBytesArray_Wrapper, PAnsiChar('update delphivcl Image object from bytes array with width, height & channels') ); FWrapper.RegisterFunction ( PAnsiChar('get_usb_camera_device_list'), CncVisionGetUSBCameraDeviceList_Wrapper, PAnsiChar('get list of available usb camera devices') ); end; Thanks in advance for the suggestions.... Best Regards Silverio
-
Hi all. There is a way to detect if compile phase is in Delphi 10.4.1 or 10.4.2 ? At Embarcadero documentation they notice only VER340 and compiler 34.0 for either: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Compiler_Versions but VCL from 10.4.1 and 10.4.2 is different and in 10.4.1 NumberBox is not available. This block 10.4.1 users to compile PythonVCL design package or force them, at any pull, to manually remove any reference to NumberBox where present in check: {$IFDEF DELPHI10_4_OR_HIGHER} ... {$ENDIF DELPHI10_4_OR_HIGHER}.
-
- delphi4python
- sydney
-
(and 1 more)
Tagged with: