Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is it possible to create a full-screen graphics without any front end elements like cell brackets and scrollbars? The zero approximation can be

{{{z, w}, {z, h}}} = FullScreenArea /. (ScreenInformation /. 
     Options[$FrontEnd, ScreenInformation]);
CreateDocument[
  Graphics[{EdgeForm[Green], Rectangle[{0, 0}, {w, h} - 1], Red, 
    AbsolutePointSize[1], Point[{100, 100}]},
   PlotRange -> {{0, w - 1}, {0, h - 1}}, ImageSize -> {w, h}],
  WindowSize -> Full];

As a result I expect a black screen with green border of one pixel width and one red pixel. I guess some options are missing to do the job, but there are quite many places one could try to put them to, so I expect someone more familiar with this functionality will respond.

share|improve this question
    
One option is to change CreateDocument to MessageDialog. Would that be something that's acceptable to you? –  rm -rf Dec 24 '12 at 15:55
    
This is much better, but still not the desired result. The goal is to get the whole monitor screen as a canvas. –  faleichik Dec 24 '12 at 16:11
2  
How about the options WindowSize->Full, ShowCellBracket -> False, WindowFrame -> "ThinFrame", WindowElements -> {}, WindowFrameElements -> {}? (or "Frameless" instead of "ThinFrame") –  kguler Dec 24 '12 at 17:11
    
Good one - would also come in very handy for presentations with fullscreen image content which usually drives me back to Powerpoint. –  Yves Klett Dec 24 '12 at 18:03

1 Answer 1

up vote 4 down vote accepted

It seems to me that you would want some sort of flexibility with this. Just setting the window size to full may not be the best solution. If I was doing it I would prefer to be making a notebook with the graphics filling the entire notebook and then toggling full screen with your graphics size to changing accordingly. To do this you need to make the image size dynamic.

CreateDocument[
  Plot[Sin[x], {x, 0, 3 Pi}, 
   ImageSize -> 
    Dynamic@AbsoluteCurrentValue[EvaluationNotebook[], WindowSize]],
  CellMargins -> 0,
  "BlinkingCellInsertionPoint" -> False,
  "CellInsertionPointCell" -> {},
  Saveable -> True,
  ShowCellBracket -> False,
  ShowCellLabel -> False,
  "TrackCellChangeTimes" -> False,
  StyleDefinitions -> "Default.nb",
  WindowFrameElements -> {"CloseBox", "ZoomBox", "MinimizeBox"},
  WindowElements -> {},
  WindowFrame -> "Normal",
  WindowSize -> All,
  WindowMargins -> Automatic,
  WindowTitle -> ""];

This is a variation of something I currently use. What happens is that initially your window opens and you control whether it goes full screen via keystrokes. On my system this means Control-Command-F (see screen grab below). When you toggle full screen the graphic expands to fit the screen. Toggle back and it shrinks to its original size. I set WindowSize->All initially but you may prefer to give the window a value e.g. {600,600}. I have used a plot to illustrate the resizing. You should set your AspectRatio to be the same as your full screen otherwise the graphic won't fit to your full screen properly. My screen aspect ratio is 5/8 so:

CreateDocument[
  Graphics[{EdgeForm[Green], Rectangle[]},
   AspectRatio -> 5/8, 
   ImageSize -> 
    Dynamic@AbsoluteCurrentValue[EvaluationNotebook[], WindowSize]],
  CellMargins -> 0,
  "BlinkingCellInsertionPoint" -> False,
  "CellInsertionPointCell" -> {},
  Saveable -> True,
  ShowCellBracket -> False,
  ShowCellLabel -> False,
  "TrackCellChangeTimes" -> False,
  StyleDefinitions -> "Default.nb",
  WindowFrameElements -> {"CloseBox", "ZoomBox", "MinimizeBox"},
  WindowElements -> {},
  WindowFrame -> "Normal",
  WindowSize -> {640, 400},
  WindowMargins -> Automatic,
  WindowTitle -> ""];

Alternatively you could make the aspect ratio dynamic as well. Note that you will see white around the graphic. To remove this set PlotRangePadding->0. The grab below shows the notebook prior to going full screen.

enter image description here

In the screen grab I used Red, AbsolutePointSize[1], Point[Scaled[{0.5, 0.5}]]. If you want to have the point position in pixel units and plot range in pixels then you would need to make some adjustments -- if you want to go down that path I will adjust the code. Personally I think using Scaled is better for managing this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.