Post by rwg on May 26, 2019 22:24:39 GMT -5
hi
i'm having a bad time with bitmaps and would like any help from out there !
the overall program i'm writing involves, in part, the plotting of XY coordinates.
my scrollable graphics window is set to width 740 and height 750 (for various reasons).
if my plotted coordinates fall to the right of this window, or to the upper side, i can scroll to locate them.
(there is a limit of course as to how far i can scroll).
but i'm happy to scroll across - it all seems to be working.
i'd like to be able to create a bitmap showing all my plotted points - even if they're beyond the 740,750 dimensions.
here's a simplistic bit of code to demonstrate my problem .....
the graphics window is set to 740 pixels wide
i'm printing the text "12345" at 900 , 80 pixels - that's 160 beyond the set width.
this is great - i can scroll across to see my plotted text.
so i'd like save the bitmap as x.bmp, hoping that points outside the 740,750 dimensions ill be saved.
WindowWidth = 740
WindowHeight = 750
UpperLeftX = 610
UpperLeftY = 1
open "my plot" for graphics as #1
B$="place "+STR$(900)+" "+STR$(80)
print #1,B$
print #1,"\12345"
print #1,"FLUSH"
print #1,"getbmp myimage 0 0 740 750"
bmpsave "myimage", "x.bmp"
close #1
WindowHeight = 750
UpperLeftX = 610
UpperLeftY = 1
open "my plot" for graphics as #1
B$="place "+STR$(900)+" "+STR$(80)
print #1,B$
print #1,"\12345"
print #1,"FLUSH"
print #1,"getbmp myimage 0 0 740 750"
bmpsave "myimage", "x.bmp"
close #1
ok, so later on i want to load the bitmap x.bmp.
after loading, i'll print the text "67890" at 900,110.
filedialog " Select Bitmap File ","*.bmp",A$
loadbmp "test", A$
open "my plot" for graphics as #5
print #5, "Drawbmp test 0 0"
'print #5,"CLS"
B$="place "+STR$(900)+" "+STR$(110)
print #5,B$
print #5,"\67890"
print #5,"FLUSH"
sometimes i get the text "12345" included, other times i don't.
it's quite random. i always get some junk - eg faded scrollbars etc on the graphics screen.
when i print #5,"CLS" after print #5, "Drawbmp test 0 0" it clears the junk but also clears my points obviously.
i've tried every combination of dimensions but i can't get it right.
i must be missing the point.
thanks all