DAS  3.1.6 - 18/09/2017
D_print.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include "mgui.h"
5 #include "bil.h"
6 #include "DAS_Spatram.h"
7 
14 void SetupPrinter(void)
15 {
16  int MPrintSetup(int po, int *xres, int *yres, int *pwidth, int *pheight, int *nplanes);
17  int xres, yres, pwidth, plength, nplanes;
18 
19  if (MPrintSetup(PO_DEFAULT, &xres, &yres, &pwidth, &plength, &nplanes))
20  {
21  char buf[128];
22 
23  sprintf(buf,
24  "Setup options:\n\
25  Paper width: %d (mm)\n\
26  Paper length: %d (mm)\n\
27  X res: %d (pixels)\n\
28  Y res: %d (pixels)\n\
29  Planes: %d",
30  pwidth, plength, xres, yres, nplanes);
31 
32  MMessageDialog("", buf, "Ok", NULL);
33  }
34 }
35 
36 
37 int PrintObject(MOBJECT obj, int mode, int x, int y )
38 {
39 
40  MPRINT_OPTIONS pe ;
41  DOC_ID did;
42  MPAGE_OPTIONS pages;
43 
44 
45  pages.startPage = pages.minPage = 1;
46  pages.endPage = pages.maxPage = 1;
47  did = MOpenPrintDoc("Print Test", False, PO_PORTRAIT, &pages);
48  if (did == NULL)
49  {
50  MMessageDialog("", "Print aborted", "Ok", NULL);
51  return 1;
52  }
53 
54  pe.mode = mode;
55  pe.x = x;
56  pe.y = y;
57  pe.w = MObjectGetWidth(obj);
58  pe.h = MObjectGetHeight(obj);
59 
60  MObjectRedraw(obj);
61  MPrintObject(obj, did, &pe);
62  MClosePrintDoc(did);
63 
64  MShellRaise(obj);
65 
66  return 0;
67 }
68 
69 
70 // OK Funziona
71 // MPrintImage(Imim, 1);
72 
int MObjectGetHeight(MOBJECT obj)
#define False
Definition: Mguidefs.h:236
void SetupPrinter(void)
Definition: D_print.c:14
int PrintObject(MOBJECT obj, int mode, int x, int y)
Definition: D_print.c:37
int MObjectGetWidth(MOBJECT obj)
void MObjectRedraw(MOBJECT obj)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void MShellRaise(MOBJECT obj)
Function prototypes.
void * MOBJECT
Definition: Mguidefs.h:192
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:07 for DAS - Rel. 3.1.6 - 18/09/2017.