Graph unit trouble! 
Author Message
 Graph unit trouble!

I made a program that uses Graph Unit to draw a picture.I want to write
some words on the picture.If I don't 'closegraph',I can't write any
word on it,but if I 'closegraph',my picture will be lost!How can I
solve this problem?
And I found some programs made in Turbo Pascal 7.0.These have windows!
How can a program runs in DOS has windows?
Please tell me!Thank you very much!

My English name is Steven and my nick name is Single-Double.

             Single-Double



Fri, 02 Dec 2005 23:36:20 GMT  
 Graph unit trouble!
I made a program that uses Graph Unit to draw a picture.I want to write
some words on the picture.If I don't 'closegraph',I can't write any
word on it,but if I 'closegraph',my picture will be lost!How can I
solve this problem?
And I found some programs made in Turbo Pascal 7.0.These have windows!
How can a program runs in DOS has windows?
Please tell me!Thank you very much!

My English name is Steven and my nick name is Single-Double.

             Single-Double



Fri, 02 Dec 2005 23:37:19 GMT  
 Graph unit trouble!



Quote:
> I made a program that uses Graph Unit to draw a picture.I want to
write
> some words on the picture.If I don't 'closegraph',I can't write any
> word on it,but if I 'closegraph',my picture will be lost!How can I
> solve this problem?
> And I found some programs made in Turbo Pascal 7.0.These have windows!
> How can a program runs in DOS has windows?
> Please tell me!Thank you very much!

> My English name is Steven and my nick name is Single-Double.

Hi steven

In graphic mode you can't use write or writeln.
You'll have to use Outtext or Outtextxy instead.

Below is a little exerpt of the BP helpfile

--
Femme

  OutTextXY (procedure)     (Graph unit)
  _______________________________________
 Sends a string to the output device.

  Declaration:
  procedure OutTextXY(X,Y: Integer; TextString: string);

  Target:
 Real, Protected

  Remarks:
 Displays TextString at (X, Y). TextString is truncated at the viewport
 border if it is too long. If one of the stroked fonts is active,
TextString
 is truncated at the screen boundary if it is too long. If the default
 (bit-mapped) font is active and the string is too long to fit on the
screen,
 no text is displayed.

 Use OutText to output text at the current pointer; use OutTextXY to
output
 text elsewhere on the screen.

 OutTextXY uses the font set by SetTextStyle. To maintain code
compatibility
 when using several fonts, use the TextWidth and TextHeight calls to
 determine the dimensions of the string.

 OutTextXY uses the output options set by SetTextJustify (justify,
center,
 rotate 90 degrees, and so on).

  Restrictions:
 Must be in graphics mode.

  See Also:
  OutText
  SetTextStyle
  SetUserCharSize
  TextHeight
  TextWidth

  Sample Code:

  {Outtxtxy.PAS}

  {Sample code for the OutTextXY procedure.}

  uses Graph;

  var
   Gd, Gm: Integer;
  begin
   Gd := Detect;
   InitGraph(Gd, Gm, ' ');
   if GraphResult <> grOk then
     Halt(1);
   MoveTo(0, 0);
   OutText('Inefficient');
   Readln;
   OutTextXY(GetX, GetY, 'Also inefficient');
   Readln;
   ClearDevice;
   OutTextXY(0, 0, 'Perfect!');   { Replaces above }
   Readln;
   CloseGraph;
  end.



Sat, 03 Dec 2005 16:45:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. problem with the graph unit-graph.tpu

2. graph unit

3. Graph unit question.

4. Patch for Graph Unit of fast PCs

5. TP7 Graph unit, conflicts with windows XP ?

6. Patch for Graph Unit of fast PCs

7. Unit Graph Problem

8. graph unit text input

9. TPW Graph unit - is anyone interested?

10. Graph Unit Help?

11. graph unit

12. graph unit

 

 
Powered by phpBB® Forum Software