Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Capturetofile better quality (pixel size)

Status
Not open for further replies.

FabienF

New member
Jul 5, 2017
19
0
0
FR
Hello everyone,
I have searched in many forums on the internet but have not find a solution.
I have a code that makes captures and save it as tif images. It works fine but I would like to enhance the image quality. Manually, I do Tools> image> Capture>Options> Pixel>rendering quality>Customized>more>set pixel size at 300%. With these settings, I have a satisfying image quality. I would thought that these settings would be saved and taken into consideration while using the capturetofile function in my code. However, it is not the case. The settings are not taken into consideration. Therefore I thought using lines of code to it. So far I have:
'--------------------------------------------
Dim CATIA As Object
Set CATIA = GetObject(, "CATIA.Application")
'-------------------------------------------
Set productDocument1 = CATIA.ActiveDocument
Set cameras1 = productDocument1.Cameras
Dim extension As String
extension = ".tif"
Dim filelocation As String
Dim strName As String
Set camera3D1 = cameras1.Item(1)
Set viewpoint3D1 = camera3D1.Viewpoint3D
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
viewer3D1.Viewpoint3D = viewpoint3D1
Set viewpoint3D1 = camera3D1.Viewpoint3D
viewer3D1.Viewpoint3D = viewpoint3D1

filelocation = "blablablabla"
strName = filelocation & nomdefichier & extension
viewer3D1.Viewpoint3D = camera3D1.Viewpoint3D
CATIA.ActiveDocument.Selection.Clear
viewer3D1.CaptureToFile 2, strName
'-----------------------------------------------------------------------------------
To change pixel size I thought of inserting just before the viewer3D1.CaptureToFile 2, strName line; these two lines : viewer3D1.Height = 2694 viewer3D1.Width = 5640 but I have an error doing that.

Can anyone help me please?

Thanking you in advance
Ps: The values of height and width I took were obtained manually when I set pixel to 300%.
 
Status
Not open for further replies.
Back
Top