Saving a #graphic

new BookmarkLockedFalling
turbov21
Guest

Guest Avatar

Post by turbov21 on Nov 9, 2007 22:07:10 GMT -5

I know the following code is wrong, but what do I do to save a Graphic out to a file?

loadimage "b1", "c:\rbp\public\junktest1円.jpg"
graphic #brainiac, 100, 100
#brainiac fill("green")
#brainiac drawimage("b1",0,0)

open "C:\rbp\public\junktest3円.jpg" for binary as #1
print #1, #brainiac
close #1

Alyce
Administrator
*****

Alyce Avatar

Posts: 519Female

Post by Alyce on Nov 10, 2007 6:48:03 GMT -5

turbov21 said:
I know the following code is wrong, but what do I do to save a Graphic out to a file?

loadimage "b1", "c:\rbp\public\junktest1円.jpg"
graphic #brainiac, 100, 100
#brainiac fill("green")
#brainiac drawimage("b1",0,0)

open "C:\rbp\public\junktest3円.jpg" for binary as #1
print #1, #brainiac
close #1


Liberty BASIC has a bmpsave command, but RB does not. Another way... LB allows you to obtain the color of a pixel with API calls, and with some complicated coding, you can write out a file header and color table in binary. (I've done it, and so have others... but it's complicated.) I don't see a way to save a bitmap in RB.

Perhaps if you tell us why you need to do this, we can suggest an alternative.
-Alyce
turbov21
Guest

Guest Avatar