Help: Uncertain gif size for multiple uses of Display function.
- To: mathgroup at smc.vnet.net
- Subject: [mg21079] Help: Uncertain gif size for multiple uses of Display function.
- From: Xing Jing Li <xingjing at calvin.math.vt.edu>
- Date: Sun, 12 Dec 1999 23:51:47 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, all, Happy holiday seasons!!! I wrote some notebook interfaces using version 3 for people in our department to make gif images of the mathematical expressions so they can be used in the web browsers. With lots of help from P. J. Hinton I finally get them to make the GIF images as big as we can see them on the screen by click a button. Hooray! Well, last week I finally got the long waited version 4. Soon after it was installed on my Mac I tried my notebooks on the new version. The interfaces are looked almost the same as they are in V3 and the speed is a lot faster. Good! Then I got some realy weird problem about the GIF files. I have an interface (NB1) saves TWO cells' contents to gif files (as a set) and anther (NB2) saves FIVE cells' contents to gif files by click the "Make GIF" button. After tried in V4 I found that for the wide images(long expressions) there is a problem. Even though the gif file is as wide as the expression should be but the content of the expression has been cut off after some 400 pixel. After some trying I found out the problems are caused by an option of the Notebook function used in the Display function. After the ButtonFunction did some NotebookFind and SelectionMove I found the directory name (path) and file name (fileID) I want to save. Then I called the Display function: Display[path<>fileID<>"1.gif", CompoundExpression[NotebookFind[ InputNotebook[ ], "Input1", All, CellTags], SelectionMove[ SelectedNotebook[ ], All, CellContents], Notebook[{Cell[NotebookRead[SelectedNotebook[ ]], FontWeight->"Plain"]}, ShowCellBracket -> False, PageWidth -> Infinity, (* here is the problem *) WindowSize -> {874, Automatic}]], "GIF", ImageSize -> {Automatic, Automatic}] In NB1 (save two cell contents as a set) there are following cases: 1. IF I only use "PageWidth -> Infinity," for the first cell then use "PageWidth -> 800," for the second cell(In V3 all PageWidth are setted 800 and they are working very well), everything I see in the cell "Input1" and "Input2" can be saved the way I saw them. I can use the button "Make GIF" as many times as I wanted and no problem. 2. If I use "PageWidth -> Infinity," for both cells then the second expression will be cut off. 3. If for both cells I use "PageWidth -> 800," then both expression will be cut off. In NB2 the phenomenon gets even more stranger.(It saves five images as a set of question and multiple choice answers.) Here I list some cases I tried: 1. If I set "PageWidth -> Infinity," in the first, third and fifth Display function and "PageWidth -> 800," in the second and forth Display function, I got five perfect gif images the first time I click the button "Make GIF". When I click the button again the first expression will be cut off and but others are OK. 2. If I set "PageWidth -> Infinity," in the second, forth Display and "PageWidth -> 800" in the first, third and fifth, same results as above. 3. If I set "PageWidth -> Infinity," in all Display then all images are been cut off. 4. If set all "PageWidth -> 800,", the first image is ok but all others are not good. If I click the button again the all five images are not complete. 5. If I set "PageWidth -> Infinity," in the first, second and third Display function and "PageWidth -> 800," in the forth and fifth Display function, then the first, forth images are good but second, third and fifth are not good. 6. If I only save FOUR cell contents and set the "PageWidth -> Infinity," in every other Display function then all the images are good. They are still good when I clicked the fifth time.(I guess that means I can click the button as many times as I want.) I do not want to bore you with all the cases I tried. The thing is that if I set the PageWidth to Infinity on every other Display function it will work. Otherwise it works strange. I think this must be some kind of bug but for which function I am not sure. Display or Notebook?? Are these happening on other platforms too? Anyone had similar experiences? Any help and suggestion are greatly appropriated. Thanks for bearing with me. Jing xingjing at math.vt.edu p.s. the whole interface code is a little too long to paste here. If you want to see what realy happens I can send you a copy of the notebooks and their codes.