×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Capturetofile better quality (pixel size)

Capturetofile better quality (pixel size)

Capturetofile better quality (pixel size)

(OP)
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%.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources