Pale
Member in Training
Posts: 24
|
Post by Pale on Apr 24, 2018 17:28:10 GMT
This applies to v1.01 and v2 . There would appear to be a limit on the size of a graphic window or graphicbox of around 2500x2500. The actual window/box can be created but when you scroll past these limits the graphics gets corrupted. I guess it is a memory limitation. I have a need to make some extremely large pictures , mostly line boxes with a bit of text in. I dont have to be able to see it all at once but I do have the need to print it. I can print up to 25,000 x 25,000 on A0. 10,000 x 10,000 might do, but 2500x2500 is just too small.
Any chance of a version 2.000001 with a bigger graphics capability.
Thanks
Pale
|
|
|
Post by cundo on Apr 24, 2018 17:48:53 GMT
Hello Pale. Try to create a BOXFILLED first with the dimensions you need, then perform a FLUSH. But yes, that is a big area of work.
|
|
|
Post by Rod on Apr 24, 2018 17:55:51 GMT
Yes it is a known bug with scrollbars. The trick in the past was to draw something as large as you need first to define the graphics area. Then the scrollbars behave.
|
|
|
Post by Rod on Apr 24, 2018 17:57:43 GMT
from the old Bug Tracker
Scrolled graphics become distorted
Description When drawing in a graphic-box (or graphics window), the graphics become distorted beyond the default scrolled view. The default scrolled view is the viewable area opened by the scrollbars that do not have limits set in the program.
Example code to demonstrate the bug. Note the two graphic windows. The left window uses the default vert and horiz limit settings of the vertscrollbar and horizscrollbar commands. The right window uses the optional height and width settings of the vertscrollbar and horizscrollbar commands. Scrolling the right graphic-box either across or down, beyond the default setting, results in distorted graphics and/or graphic text.
WindowWidth = 800 WindowHeight = 600 graphicbox #demo.g1, 20, 20, 350, 500 graphicbox #demo.g2, 410, 20, 350, 500 open "Graphics Glitch Demo" for window as #demo #demo "trapclose [quit]" #demo.g1 "vertscrollbar on" #demo.g1 "horizscrollbar on" #demo.g2 "vertscrollbar on 0 1350" #demo.g2 "horizscrollbar on 0 2150" for i = 1 to 2 h$ = "#demo.g";i #h$ "down; color black; backcolor white" ' #h$ "place 0 0; boxfilled 2500 1850" x = 10 for j = 0 to 2400 step 100 #h$ "place ";x;" 20" #h$ "\";j #h$ "place ";x + 15;" 50" #h$ "circle 25" x = x + 100 next j y = 20 for j = 0 to 1800 step 100 #h$ "place 10 ";y #h$ "\";j #h$ "place 25 ";y + 30 #h$ "circle 25" y = y + 100 next j #h$ "flush" next i wait [quit] close #demo end
Example to code work around the bug. To prevent distorted graphics, use the boxfilled command to access the entire area to be viewed before drawing graphics or graphic text. WindowWidth = 800 WindowHeight = 600 graphicbox #demo.g1, 20, 20, 350, 500 graphicbox #demo.g2, 410, 20, 350, 500 open "Graphics Glitch Workaround" for window as #demo #demo "trapclose [quit]" #demo.g1 "vertscrollbar on" #demo.g1 "horizscrollbar on" #demo.g2 "vertscrollbar on 0 1350" #demo.g2 "horizscrollbar on 0 2150" for i = 1 to 2 h$ = "#demo.g";i #h$ "down; color black; backcolor white" ' Accessing the entire viewing area with the boxfilled command ' will prevent future drawn graphics from becoming distorted #h$ "place 0 0; boxfilled 2500 1850" x = 10 for j = 0 to 2400 step 100 #h$ "place ";x;" 20" #h$ "\";j #h$ "place ";x + 15;" 50" #h$ "circle 25" x = x + 100 next j y = 20 for j = 0 to 1800 step 100 #h$ "place 10 ";y #h$ "\";j #h$ "place 25 ";y + 30 #h$ "circle 25" y = y + 100 next j #h$ "flush" next i wait [quit] close #demo end
|
|
|
Post by Rod on Apr 24, 2018 18:02:08 GMT
I can't even create 25000x25000 in Paint Shop Pro never mind load it at 2Gb. Just BASIC has a limit of 256Mb of memory so you will need to lower your expectations.
|
|
|
Post by Rod on Apr 24, 2018 18:14:40 GMT
I wonder if you need that many pixels. The size parameter spreads pixels across the printed page so you could fill an A0 page with 600 pixels, so it would look yuk, but you could spread 5000 pixels across A0 and it might look acceptable. SO perhaps the size parameter is not correct. It defaults to your screen width if not specified. That can mean that graphics look tiny, (if your screen is 2000 pixels wide and you draw a graphicbox 700 pixels wide, by default it will fill only one third of the printed page, setting size to 700 will fill the printed page.) folks compensate by throwing more pixels at it but all that you really need to do is change the size parameter. Graphics Printing
|
|
Pale
Member in Training
Posts: 24
|
Post by Pale on Apr 25, 2018 18:26:20 GMT
I re wrote some of the graphics code today to scale what is needed . The text on the screen got quite hard to read but the printout was readable. The graphics just contains boxes with some text in and lines connecting them. The task I am working on is a graphical display of the links between sequences on a Honeywell TDC 3000 control system. There are around 800 sequences linked by around 20,000 variables and I want to make a map of these interconnections. It is a massive spiders web on LSD. I started in CAD but this was soon ruled out. There could be from a couple links to, a couple of thousand links, in each picture. Seeing as the scaled down print out is more readable than the screen and this work around I may get this working. I have just read up on the SIZE parameter, I missed this. The boxes I am using are 20 x 80 with 16 point text in them. I have been scaling these down on the screen to print them but when you get down to 4 point and 5 x 20 boxes thing start to overlap . full size of 20x80 at this size the full image is 6060 pixels wide at 50% 3030 pixels at 25% 1515 pixels I am not sure how big some of these will get as I am only testing with a subset of the full database. A vertical rather than horizontal arrangement may be more screen efficient. I will have a play with the size parameter and pre defined graphics boxes tomorrow. Thank you for your help and very quick response. My trouble is I have been programming for 30 odd years and always try to run before I can walk with at new language. Pale
|
|
Pale
Member in Training
Posts: 24
|
Post by Pale on Apr 26, 2018 15:24:23 GMT
Ok had a play with the boxfill and sorted the graphics done at least 7000 pixels wide so far so looking good. I did notice that the
#h$ "down; color black; backcolor white"
is important else the workaround does not work.
I got the "print size" part working too which auto sizes my pictures for printing. Not quite sure how this will work with a PDF printer , but I'll sort that when I get there.
So all looking good
Thank you very much for your help
Pale
|
|
|
Post by cundo on Apr 27, 2018 20:43:56 GMT
As always there is another way to accomplish a similar result, instead of using scrollbars and a really big image: Draw the screen on demand while dragging it around with the mouseMove/ leftButtonDown commands.
By the way, if I remember correctly the limitation also involves memory available. I did many test on this, and got different results on different PCs. It's a real big image anyway.
|
|
Pale
Member in Training
Posts: 24
|
Post by Pale on Apr 28, 2018 19:36:06 GMT
Alas the print out is the important part. I have now had some pictures 27,900 pixels wide not sure how high. This is somewhat unwheildy and I am in the process of changing the layout to reduce this. I also need to look a little closer at the database searches that are creating these images, as of the 22,000 links in the database I managed to display 46,000 of them! My de-duplication loop must have a hole in it. I am thinking of a reduction in data shown in the result window with links embedded to open a new window with a detailed subset of the results shown. Pale
|
|