pyOCCT icon indicating copy to clipboard operation
pyOCCT copied to clipboard

Image_Pixmap().Data pointer?

Open cylopa opened this issue 5 years ago • 3 comments

I am trying to convert V3d_View contents into a QPixmap object. Using V3d_View we can Dump contents of the View to an image file. Using ToPixMap we can dump them to an Image_PixMap object. But Image_Pixmap.Data() returns an int? There is also InitWrapper method that takes a pointer as int?

cylopa avatar Oct 06 '20 08:10 cylopa

Could Image_Pixmap.Data() return as bytes object?

So we can do something like this: ` image_pixmap = Image_PixMap() v3d_view.ToPixMap(image_pixmap, width, height) data_bytes: bytes = image_pixmap.Data() # Currently returns an int.

q_pixmap = QPixmap() q_bytearray = QByteArray(data_bytes) q_pixmap.loadFromData(q_bytearray) `

cylopa avatar Oct 07 '20 06:10 cylopa

Or could it return a memoryview object?

data_bytes: memoryview= image_pixmap.Data()

cylopa avatar Oct 08 '20 15:10 cylopa

This seems pretty low-level, what are you trying to achieve?

trelau avatar Jan 18 '21 15:01 trelau