Open yuanningcz opened 1 week ago
I want to write a huge picture in a skp file. For example, width:100000 inches,height: 100000 inches。
double fWidth = 10E5; double fHeight = 10E5; sRes = SUImageRepResize(sImageRep, fWdith, fHeight);
Looks like you are conflating model units and pixel units here.
SUImagRepRef
deals with pixels, not model units. You are creating an image that is 100000px x 100000px - here. If that's 8bpp that's ten gibabytes! If this is 24bpp that's thirty gigabytes. Does that code even complete? You don't run out of memory?
From the rest of your code it appear that you load an image file using SUImageRepRef
and then try to create an Image entity; SUImageRef
. Note that these are very different things. SUImageRepRef
is a data structure to hold the pixel data. SUImageRef
is a drawing element that displays that displays images in the model.
SUImageRef
is essentially a specialized form of a Group or Component instance.
If you want the Image to be 100000x100000 inches in model space you create a transformation that scales the Image entity to that size. You don't resize the pixel data for that.
SketchUp version:2024 OS Platform: win10 x64 C API
I want to write a huge picture in a skp file. For example, width:100000 inches,height: 100000 inches。 Here is what I did:
SUImageRepResize takes a very long time to complete。 Is there any other faster way to create a super large image in skp file?