1. saving to bitmap files

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

new topic     » topic index » view message » categorize

2. Re: saving to bitmap files

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: saving to bitmap files

mattlewis said...
DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: saving to bitmap files

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: saving to bitmap files

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: saving to bitmap files

mattlewis said...
DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

7. Re: saving to bitmap files

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

8. Re: saving to bitmap files

You're right, it'd be in my app, so wouldn't be as hard as I imagined smile

Dan

new topic     » goto parent     » topic index » view message » categorize

9. Re: saving to bitmap files

DanM said...

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

win32lib docs said...

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

new topic     » goto parent     » topic index » view message » categorize

10. Re: saving to bitmap files

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

new topic     » goto parent     » topic index » view message » categorize

11. Re: saving to bitmap files

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

12. Re: saving to bitmap files

CChris said...

No known complaints from users of 0.7x series, so it must be working just as well.

Nominated for Quote of the Day. smile

Matt

new topic     » goto parent     » topic index » view message » categorize

13. Re: saving to bitmap files

Not sure yet if speed will be a concern, but I went and got his lib to check it out, thanks again Chris grin

Dan

new topic     » goto parent     » topic index » view message » categorize

14. Re: saving to bitmap files

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

new topic     » goto parent     » topic index » view message » categorize

15. Re: saving to bitmap files

otterdad said...

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

new topic     » goto parent     » topic index » view message » categorize

16. Re: saving to bitmap files

DanM said...
otterdad said...

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

new topic     » goto parent     » topic index » view message » categorize

17. Re: saving to bitmap files

Otterdad,

did you get my addy decoded? I haven't received it yet.

Dan

new topic     » goto parent     » topic index » view message » categorize

18. Re: saving to bitmap files

yahoo gave me problems - said you didn't exist - i'll try again from home tonight - could be my corporate firewall

new topic     » goto parent     » topic index » view message » categorize

19. Re: saving to bitmap files

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

new topic     » goto parent     » topic index » view message » categorize

20. Re: saving to bitmap files

Otterdad,

got it, there's a lot there!

Dan

new topic     » goto parent     » topic index » view message » categorize

21. Re: saving to bitmap files

DanM said...

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!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu