
getting the print screen image of a graphic view
By
acam, in Mastercam C-Hook, NET-Hook and VBScript Development
Recommended Posts
Gorazd,
Have you tried ...
Mastercam.Mastercam.IO.FileManager.SaveToBitmap(String FilePath)
"This is used to save the graphics view of the currently opened file to a bitmap file."
Parameters: FilePath (String)
This should be the full, backslash-delimited path of the bitmap file you wish to create.
Return Value:
True if the bitmap file was created successfully and false if not.
acam 3
yeah, but this one only creates bitmap 256x256 pixels.
I would like to have a big image.
Regards.
Yes, that is what is does.
So... you don't want the full screen, but this image is too small. Just cannot make you happy!
I assume what you're trying to capture the the "entire" graphics area, whatever size it is ?
-
1
acam 3
Yes, that's it.
If the current graphic screen is 1052x897 (it depends on the size of the screen and the number of toolbars the user has ) I want to capture it into the image of the same size.
I always wandered why the SaveToBitmap(String FilePath) didn't save to a large image.
Ususaly we need printscreens bigger than 256x256.
I want to have the same functionality as "Screen/Copy screen image to clipboard" does (it creates imege of the graphic screen in the original size).
Best regards.
Gorazd,
Check your email...
-
1
acam 3
thanks
Hello and a lucky new year to you all,
i have a further question about creating screenshot or better creating a print like File/Print.
Let's assume, that the setup for printer, orientation, color etc. is done.
Is it then possible to control that print function with a chook-function (in MC2019 and above) ?
Maybe the undocumented function "send_file_to_printer(class CStdioFile *, int, wchar_t *)" is the key for that?
Please help.
Best regards
Maybe? - PrintFileDirect()
declared in MastercamDoc_CH.h
Thank you Roger,
that works fine.
But now i have found that i cant't store that print in a file without manually enter the path (with an pdf printer driver). That's what i want to avoid.
Now i think like acam did. Make a printscreen image and than store it as a bmp in the directory where the mc-file lives.
I'm able to store that bmp with "screen_to_bitmap_file(...)"
That works also. But what if i want to manipulate that image before storing it. Saw the function "screen _to_Bitmap(...)" and got the same problems as acam.
How to get the bitmap-size in "graphic screen in the original size"?
Best regards
Norbert
Norbert,
Try this function -
DLLImport bool screen_to_bitmap_file (TCHAR *pFileName, bool thumbnail = true);
It is the native (C++) method that the NET-Hook API is using via -
bool FileManager.SaveToBitmap (string FilePath, bool Thumbnail)
-
1
Roger,
that works fine!
Thank you for your help.
-
1
-
Recently Browsing 0 members
No registered users viewing this page.
Hello,
I have another question regarding Nethook options.
I would like to make a printscreen image of a graphic view.
I can succesfully save the image of the entire screen. I use this method for this:
But the problem is that this method returns image of the entire screen.
I would like to get the image of only a graphic window.
I see 2 possible solutions to this:
I was checking the Nethhok help but I see no option to achieve any of these using nethook functions.
Any of the solutions would be greatly appreciated.
Thanks
Share this post
Link to post
Share on other sites