×
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

How to create capture image (not use Capturetofile)

How to create capture image (not use Capturetofile)

How to create capture image (not use Capturetofile)

(OP)
I am trying to write a macro to

Step1.get capture image(like:tools>image>captures)
Step2.paste one for MSexcel sheet

I cant find solution for Step1.I tryed to use Sendkey Command but didn't.
I have found posts that show how to capture to file, do a screen shot through windows but those do not help.
I want to treat more higher resolution image by the setting like a CaptureOptions(in tools>image>captures).

Please help me with having a macro do a copy of an image and not a caturetofile.

RE: How to create capture image (not use Capturetofile)

Hello kls113,

My code has been for long time in VB.net.
I think this quality being equivalent high.
You can ref it.

-----------------------------------------------------------------

Imports INFITF
Imports MECMOD
Imports System.IO '---> Khai báo thư viện cho hàm xóa file Delete

Public Class Form1
Public ten_file As String = "C:\vbtemp\foto1.bmp"
Public Sub hienThifoto()
pibCapture.Image = Image.FromFile(ten_file)
End Sub

Private Sub btnCapNhat_Click(sender As Object, e As EventArgs) Handles btnCapNhat.Click
Dim CATIA As INFITF.Application
CATIA = GetObject(, "CATIA.Application")
If CATIA Is Nothing Then CATIA = CreateObject("CATIA.Application")
Dim view_hien_hanh As Viewer
view_hien_hanh = CATIA.ActiveWindow.ActiveViewer '--->Gán trạng thái màn hình active cho biến view_hien_hanh
view_hien_hanh.Update() '---> Update lại View
'view_hien_hanh.Reframe() '--->Đưa màn hình về Fit Mode
'---Xoa file foto1.bmp truoc khi gui ra picturebox
Call view_hien_hanh.CaptureToFile(CatCaptureFormat.catCaptureFormatBMP, ten_file)
CATIA.RefreshDisplay = True
Call hienThifoto()
End Sub

Private Sub btnXoaAnh_Click(sender As Object, e As EventArgs) Handles btnXoaAnh.Click
pibCapture.Image = Nothing
'System.IO.File.Delete(ten_file)
End Sub
End Class




Enjoy!

CATIAketnoi
Engineering Connecting and Collaboration
-------------------------
www.facebook.com/CATIAketnoi
www.youtube.com/channel/UCHdO9EoDWEXgXWaGPP-ejVA

RE: How to create capture image (not use Capturetofile)

(OP)
Hi dung nguyen!
Thanks for your code, but I'd like to set any resolution(ex.W:2500px H:1800px), do you have any solution?
For images output as standard function(Capturetofile), the resolution is not sufficient to read many text, so I'd like to know the manual setting method please.

RE: How to create capture image (not use Capturetofile)

Hi
i recreated this macro, and make it more simple, i figure it out that this macro get dimension from your screen
so if you have big screen you will got bigger picture.

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