Hello,
I would like to get a good view of an element in a document in Bitmap format. How would I go about doing this? I need it in Bitmap format because I would like to put it in winforms, showing a preview of the element.
I've checked out doc.ExportImage but that does not return a Bitmap and instead saves the file somewhere else.
I've also looked at elemType.GetPreviewImage, but the element I am looking at has no preview image.
Thanks in advance.
Since the two methods you mention are what is currently offered by the Revit API, I would suggest performing some research to find out how you can use them. It might be a long time before any other options crop up.
You could use ExportImage and then process to resulting file to retrieve a bitmap from that.
Alternatively, you could research how to ensure that GetPreviewImage does indeed return a suitable result.
Here are some examples showing how it can be used:
Alright got it thanks.
Since those are the only two options, I'll export the image into a temporary location, then load them into Bitmap.
Way to go!
Can't find what you're looking for? Ask the community or share your knowledge.