1. saving to bitmap files
- Posted by DanM Jan 11, 2009
- 919 views
I'd like to add ability to save to bitmap files to a program, but when I look at Win32Lib "copyToBitmapFile", I see that it's indicated to be very slow, and limited to 256 colors.
And I couldn't find any demos to do this with Win32Lib, or contributions at RapidEuphoria. Anyone have any good ideas or examples, particularly faster and/or more colors?
Dan
2. Re: saving to bitmap files
- Posted by mattlewis (admin) Jan 11, 2009
- 914 views
I'd like to add ability to save to bitmap files to a program, but when I look at Win32Lib "copyToBitmapFile", I see that it's indicated to be very slow, and limited to 256 colors.
And I couldn't find any demos to do this with Win32Lib, or contributions at RapidEuphoria. Anyone have any good ideas or examples, particularly faster and/or more colors?
Have you looked at save_bitmap in wxEuphoria? It can save in multiple formats (bmp, gif, png, jpeg).
Matt
3. Re: saving to bitmap files
- Posted by DanM Jan 11, 2009
- 907 views
I'd like to add ability to save to bitmap files to a program, but when I look at Win32Lib "copyToBitmapFile", I see that it's indicated to be very slow, and limited to 256 colors.
And I couldn't find any demos to do this with Win32Lib, or contributions at RapidEuphoria. Anyone have any good ideas or examples, particularly faster and/or more colors?
Have you looked at save_bitmap in wxEuphoria? It can save in multiple formats (bmp, gif, png, jpeg).
Matt
No, but I will! I'm more comfortable with Win32Lib & its IDE, and only recently started using wxEuphoria for controls Win32Lib lacks, like html window, so I never even thought to look at wxEuphoria for this task. Now I will. Thanks.
Dan
4. Re: saving to bitmap files
- Posted by DanM Jan 11, 2009
- 982 views
Does wxEuphoria's save_bitmap allow saving a window as a bitmap?? As I look at the wxEuphoria doc, it doesn't seem to, though I'm not sure & there's no demo for that.
I'm pretty sure the Win32Lib function does scan & save a window, and that's what I'm interested in.
Dan
5. Re: saving to bitmap files
- Posted by mattlewis (admin) Jan 11, 2009
- 945 views
Does wxEuphoria's save_bitmap allow saving a window as a bitmap?? As I look at the wxEuphoria doc, it doesn't seem to, though I'm not sure & there's no demo for that.
I'm pretty sure the Win32Lib function does scan & save a window, and that's what I'm interested in.
Looks like it would need some extra work to do this. I think if we wrapped wxScreenDC, then you could use that in combination with wxWindow::GetScreenRect to blit out the part of the screen you wanted to your own image.
Matt
6. Re: saving to bitmap files
- Posted by DanM Jan 11, 2009
- 919 views
Does wxEuphoria's save_bitmap allow saving a window as a bitmap?? As I look at the wxEuphoria doc, it doesn't seem to, though I'm not sure & there's no demo for that.
I'm pretty sure the Win32Lib function does scan & save a window, and that's what I'm interested in.
Looks like it would need some extra work to do this. I think if we wrapped wxScreenDC, then you could use that in combination with wxWindow::GetScreenRect to blit out the part of the screen you wanted to your own image.
Matt
So even with the future wrap, still couldn't just specify to get or scan a specified window, would have to programatically figure where a window was on the screen, making sure not to get any title bar or menu content, in order to get the window's desired content put into .bmp file?
Dan
7. Re: saving to bitmap files
- Posted by mattlewis (admin) Jan 11, 2009
- 902 views
So even with the future wrap, still couldn't just specify to get or scan a specified window, would have to programatically figure where a window was on the screen, making sure not to get any title bar or menu content, in order to get the window's desired content put into .bmp file?
Are you interested in a window that's part of your app, or just an arbitrary window? If it's yours, then it's easy, because you can get the coordinates. It would probably take 4 or 5 lines of euphoria to do this. I'm not sure if there's an easy way to get that information from windows belonging to other processes.
Matt
8. Re: saving to bitmap files
- Posted by DanM Jan 11, 2009
- 911 views
You're right, it'd be in my app, so wouldn't be as hard as I imagined
Dan
9. Re: saving to bitmap files
- Posted by CChris Jan 12, 2009
- 920 views
Does wxEuphoria's save_bitmap allow saving a window as a bitmap?? As I look at the wxEuphoria doc, it doesn't seem to, though I'm not sure & there's no demo for that.
I'm pretty sure the Win32Lib function does scan & save a window, and that's what I'm interested in.
Dan
copyToTrueColorBitmapFile ( window, fileName, x1, y1, x2, y2 )
Copies image from window to file fileName.
Returns: Returns 0 if succeeds.
x1 and y1 refer to the top left pixel corner of the image, and x2 and y2 refer to the bottom right corner of the image.
Note 1: It uses getPixel , so it's slow.
Note 2: It uses the full 24-bit color range (16+ million colors).
Example:
-- save {0,0} {100,100} on the screen to a file copyToTrueColorBitmapFile( Screen, "screen.bmp", 0, 0, 100, 100 )
CChris
10. Re: saving to bitmap files
- Posted by DanM Jan 12, 2009
- 958 views
I don't know how I could possibly miss the function RIGHT BELOW THE ONE I WAS LOOKING AT, with practically the same name, but obviously I did. Sigh.
Thank you Chris, for pointing it out to me, so far that looks like it will work just fine.
Dan
11. Re: saving to bitmap files
- Posted by CChris Jan 12, 2009
- 963 views
I don't know how I could possibly miss the function RIGHT BELOW THE ONE I WAS LOOKING AT, with practically the same name, but obviously I did. Sigh.
Thank you Chris, for pointing it out to me, so far that looks like it will work just fine.
Dan
And if speed is a concern, you may want to look at Win32Dib by T. Carlier, which provides a handy way to process bitmaps in a device-independent, win32lib-compatible way. Beware that pixels are encoded as BGR, not RGB. Requires v0.60+. No known complaints from users of 0.7x series, so it must be working just as well.
CChris
12. Re: saving to bitmap files
- Posted by mattlewis (admin) Jan 12, 2009
- 970 views
No known complaints from users of 0.7x series, so it must be working just as well.
Nominated for Quote of the Day.
Matt
13. Re: saving to bitmap files
- Posted by DanM Jan 12, 2009
- 878 views
Not sure yet if speed will be a concern, but I went and got his lib to check it out, thanks again Chris
Dan
14. Re: saving to bitmap files
- Posted by otterdad Jan 12, 2009
- 875 views
I just finished an app called ScreenShot that takes full screen captures every x minutes and saves them as reduced color bitmaps (for increased speed and decreased size) to a centralized network drive. Takes less than one second for complete operation. I use it to monitor some off-site machines without actually having to remote into them. It also uses win32dib. I didn't think anybody would be interested in it. If you want it I’d be happy to email it.
OtterDad
15. Re: saving to bitmap files
- Posted by DanM Jan 13, 2009
- 945 views
I just finished an app called ScreenShot that takes full screen captures every x minutes and saves them as reduced color bitmaps (for increased speed and decreased size) to a centralized network drive. Takes less than one second for complete operation. I use it to monitor some off-site machines without actually having to remote into them. It also uses win32dib. I didn't think anybody would be interested in it. If you want it I’d be happy to email it.
OtterDad
I'd appreciate any opportunity to see examples, haven't looked into the download yet. So yes, you could email it to me at:
euph2005-eudan(atNoSpam)yahoo(daught)com
Thanks,
Dan
16. Re: saving to bitmap files
- Posted by otterdad Jan 13, 2009
- 961 views
I just finished an app called ScreenShot that takes full screen captures every x minutes and saves them as reduced color bitmaps (for increased speed and decreased size) to a centralized network drive. Takes less than one second for complete operation. I use it to monitor some off-site machines without actually having to remote into them. It also uses win32dib. I didn't think anybody would be interested in it. If you want it I’d be happy to email it.
OtterDad
I'd appreciate any opportunity to see examples, haven't looked into the download yet. So yes, you could email it to me at:
euph2005-eudan(atNoSpam)yahoo(daught)com
Thanks,
Dan
on it's way to you - let me know if it misbevaves
OtterDad
17. Re: saving to bitmap files
- Posted by DanM Jan 13, 2009
- 888 views
Otterdad,
did you get my addy decoded? I haven't received it yet.
Dan
18. Re: saving to bitmap files
- Posted by otterdad Jan 13, 2009
- 885 views
yahoo gave me problems - said you didn't exist - i'll try again from home tonight - could be my corporate firewall
19. Re: saving to bitmap files
- Posted by DanM Jan 14, 2009
- 883 views
Otterdad,
I just emailed my addy below & received it fine. Just make sure to replace the items in parentheses with the appropriate punctuation marks, leaving off the parentheses.
euph2005-eudan(atNoSpam)yahoo(daught)com
Dan
20. Re: saving to bitmap files
- Posted by DanM Jan 14, 2009
- 852 views
Otterdad,
got it, there's a lot there!
Dan
21. Re: saving to bitmap files
- Posted by otterdad Jan 14, 2009
- 860 views
Otterdad,
got it, there's a lot there!
Dan
there's a lot of my own code in there as well as the core win32 code. you can disable a lot of the fancy features like automatic scaling, debugging messages to the display server, etc. should run as is. let me know if you need help!