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.
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)
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)
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)
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.