本文整理汇总了C++中EndPage函数的典型用法代码示例。如果您正苦于以下问题:C++ EndPage函数的具体用法?C++ EndPage怎么用?C++ EndPage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EndPage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetProfileString
void CComPrint::PrintBmp(UINT nBmpId)
{
char szPrinter[200] = "";
char *pszDevice = NULL;
char *pszDriver = NULL;
char *pszOutput = NULL;
HDC hdcPrint = NULL; // 定义一个设备环境句柄
static DOCINFO di={sizeof(DOCINFO),"printer",NULL};
// 得到设备字符串存入数组szPrinter中
GetProfileString("windows","device",",,,",szPrinter,80);
// 将设备字符串分解
if( (NULL != (pszDevice = strtok(szPrinter,","))) &&
(NULL != (pszDriver = strtok(NULL,","))) &&
(NULL != (pszOutput = strtok(NULL,","))))
{
// 创建一个打印机设备句柄
if((hdcPrint = CreateDC(pszDriver,pszDevice, pszOutput, NULL)) != 0)
{
if (StartDoc(hdcPrint, &di) > 0) //开始执行一个打印作业
{
StartPage(hdcPrint); //打印机走纸,开始打印
SaveDC(hdcPrint); //保存打印机设备句柄
#pragma warning(disable:4312)
// 输出图片
HBITMAP hBitmap=::LoadBitmap(AfxGetInstanceHandle(),(LPCTSTR)nBmpId);
BITMAP bitmap;
::GetObject(hBitmap,sizeof(BITMAP),&bitmap);
#pragma warning(default:4312)
HDC dcMem;
dcMem=::CreateCompatibleDC(hdcPrint);
HBITMAP hOldBmp=(HBITMAP)::SelectObject(dcMem,hBitmap);
int nVertCenterPos = ::GetDeviceCaps(hdcPrint, VERTRES) / 2;
::StretchBlt(hdcPrint,1,50,400,bitmap.bmHeight,dcMem,0,0,bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
::SelectObject(dcMem,hOldBmp);
::DeleteDC(dcMem);
::DeleteObject(hBitmap);
RestoreDC(hdcPrint,-1); //恢复打印机设备句柄
EndPage(hdcPrint); //打印机停纸,停止打印
EndDoc(hdcPrint); //结束一个打印作业
}
// 用API函数DeleteDC销毁一个打印机设备句柄
DeleteDC(hdcPrint);
}
}
}
开发者ID:tempbottle,项目名称:TestSet,代码行数:57,代码来源:ComPrint.cpp
示例2: finishPage
int finishPage(const int pdcID) {
HDC pdc = printerDCs[pdcID];
if (pdc != NULL) {
if (EndPage(pdc) > 0) {
return JNI_TRUE;
}
}
return JNI_FALSE;
}
开发者ID:hzwjava,项目名称:ORDER,代码行数:9,代码来源:print.cpp
示例3: apc_prn_new_page
Bool
apc_prn_new_page( Handle self)
{
apcErrClear;
objCheck false;
if ( EndPage( sys ps) < 0) apiPrnErr;
if ( StartPage( sys ps) < 0) apiPrnErr;
return apcError == errOk;
}
开发者ID:Absolight,项目名称:Prima,代码行数:9,代码来源:dev.c
示例4: cdflush
/*
%F cdFlush para Printer.
Termina uma pagina e inicia outra.
*/
static void cdflush(cdCtxCanvas* ctxcanvas)
{
delete ctxcanvas->graphics;
EndPage(ctxcanvas->hDC);
StartPage(ctxcanvas->hDC);
ctxcanvas->graphics = new Graphics(ctxcanvas->hDC, ctxcanvas->printerHandle);
cdwpUpdateCanvas(ctxcanvas);
}
开发者ID:LuaDist,项目名称:cd,代码行数:14,代码来源:cdwprnp.cpp
示例5: gdi_abort
/*
* Clean up the GDI data structures without attempting any more printing.
*/
static void
gdi_abort(void)
{
if (pstate.out_row) {
(void) EndPage(pstate.dlg.hDC);
pstate.out_row = 0;
}
(void) EndDoc(pstate.dlg.hDC);
cleanup_fonts();
}
开发者ID:Oxyoptia,项目名称:x3270,代码行数:14,代码来源:gdi_print.c
示例6: SimplePrint
void SimplePrint(int nPages)
{
TCHAR temp[MAX_PATH];
DWORD size = MAX_PATH;
GetDefaultPrinter(temp, & size); // default printer name
HDC hDC = CreateDC(NULL, temp, NULL, NULL); // DC with default setting
if ( hDC )
{
nCall_AbortProc = 0;
SetAbortProc(hDC, SimpleAbortProc);
DOCINFO docinfo;
docinfo.cbSize = sizeof(docinfo);
docinfo.lpszDocName = _T("SimplePrint");
docinfo.lpszOutput = NULL;
docinfo.lpszDatatype = _T("EMF");
docinfo.fwType = 0;
if ( StartDoc(hDC, & docinfo) > 0 )
{
for (int p=0; p<nPages; p++) // one page at a time
if ( StartPage(hDC) <= 0 )
break;
else
{
int width = GetDeviceCaps(hDC, HORZRES);
int height = GetDeviceCaps(hDC, VERTRES);
int dpix = GetDeviceCaps(hDC, LOGPIXELSX);
int dpiy = GetDeviceCaps(hDC, LOGPIXELSY);
wsprintf(temp, _T("Page %d of %d"), p+1, nPages);
SetTextAlign(hDC, TA_TOP | TA_RIGHT );
TextOut(hDC, width, 0, temp, _tcslen(temp));
Rectangle(hDC, 0, 0, dpix, dpiy);
Rectangle(hDC, width, height, width-dpix, height-dpiy);
if ( EndPage(hDC)<0 )
break;
}
EndDoc(hDC);
}
DeleteDC(hDC);
}
wsprintf(temp, "AbortProc called %d times", nCall_AbortProc);
MessageBox(NULL, temp, "SimlePrint", MB_OK);
}
开发者ID:b2kguga,项目名称:CodesAndNotes,代码行数:53,代码来源:Printer.cpp
示例7: dlg
void Editor::print(){
static const int MARG=720; //1440=1 inch
CPrintDialog dlg(false);
int e=dlg.DoModal();if( e==IDCANCEL ) return;
HDC hdc=dlg.GetPrinterDC();
if( !hdc ){
MessageBox( "Error printing" );
return;
}
int hr=GetDeviceCaps(hdc,HORZRES),vr=GetDeviceCaps(hdc,VERTRES);
int px=GetDeviceCaps(hdc,LOGPIXELSX),py=GetDeviceCaps(hdc,LOGPIXELSY);
SetMapMode(hdc,MM_TEXT);
FORMATRANGE fr={0};
fr.hdc=fr.hdcTarget=hdc;
fr.rcPage.left=fr.rcPage.top=0;
fr.rcPage.right=(hr/px)*1440;
fr.rcPage.bottom=(vr/py)*1440;
//margins
fr.rc.left=fr.rcPage.left+MARG;
fr.rc.top=fr.rcPage.top+MARG;
fr.rc.right=fr.rcPage.right-MARG;
fr.rc.bottom=fr.rcPage.bottom-MARG;
char buff[MAX_PATH];
strcpy( buff,name.c_str() );
DOCINFO di={sizeof(di)};
di.lpszDocName=buff;
getSel();
int start=selStart,end=selEnd;
if( start==end ){ start=0;end=editCtrl.GetTextLength(); }
StartDoc(hdc,&di);
while( start<end ){
StartPage(hdc);
fr.chrg.cpMin=start;
fr.chrg.cpMax=end;
start=editCtrl.FormatRange(&fr,true);
EndPage(hdc);
}
EndDoc(hdc);
editCtrl.FormatRange(0,false);
DeleteDC(hdc);
}
开发者ID:kfprimm,项目名称:blitz3d-ng,代码行数:53,代码来源:editor.cpp
示例8: cdkillcanvas
/*
%F cdKillCanvas para Printer.
Termina a pagina e termina o documento, enviando-o para a impressora.
*/
static void cdkillcanvas (cdCtxCanvas *ctxcanvas)
{
EndPage(ctxcanvas->hDC);
EndDoc(ctxcanvas->hDC);
cdwKillCanvas(ctxcanvas);
DeleteDC(ctxcanvas->hDC);
memset(ctxcanvas, 0, sizeof(cdCtxCanvas));
free(ctxcanvas);
}
开发者ID:gcfavorites,项目名称:tastools,代码行数:16,代码来源:cdwprn.c
示例9: cdkillcanvas
/*
%F cdKillCanvas para Printer.
Termina a pagina e termina o documento, enviando-o para a impressora.
*/
static void cdkillcanvas (cdCtxCanvas* ctxcanvas)
{
cdwpKillCanvas(ctxcanvas);
EndPage(ctxcanvas->hDC);
EndDoc(ctxcanvas->hDC);
ClosePrinter(ctxcanvas->printerHandle);
DeleteDC(ctxcanvas->hDC);
delete ctxcanvas;
}
开发者ID:LuaDist,项目名称:cd,代码行数:16,代码来源:cdwprnp.cpp
示例10: NewPage
BOOL
NewPage(
IN HANDLE PrinterDC
)
/*++
Routine Description:
NewPage - Do printer EndPage and StartPage. Reset NumLines.
Arguments:
PrinterDC - HDC of the printer
Return Value:
BOOL - TRUE if we got a valid Printer DC, FALSE otherwise.
--*/
{
int nError;
nError = EndPage( PrinterDC );
if (nError <= 0) {
// PrinterError( hWnd, PrinterDC, (LPTSTR) GetString( IDS_END_PAGE ) );
return FALSE;
}
nError = StartPage( PrinterDC );
if (nError <= 0) {
// PrinterError( hWnd, PrinterDC, (LPTSTR) GetString( IDS_START_PAGE ) );
return FALSE;
}
//
// Set the current line number to the top of the page.
//
LineNumber = 1;
return TRUE;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:50,代码来源:printer.c
示例11: print
static bool print(ITile *pDraw)
{
PRINTDLG pd = {0};
pd.lStructSize = sizeof pd;
/*
* get rid of PD_RETURNDEFAULT on the line below if you'd like to
* see the "Printer Settings" dialog!
*
*/
pd.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
// try to retrieve the printer DC
if( !PrintDlg(&pd) )
{
return false;
}
DOCINFO di = {0};
HDC hPrinter = pd.hDC;
// initialization of the printing!
// start the first and only page
Printer canvas(hPrinter);
RECT rect = {0};
canvas.GetClipBox(&rect);
Tiles::rect_t wrect;
wrect.x = rect.left;
wrect.y = rect.top;
wrect.wide = rect.right - rect.left;
wrect.high = rect.bottom - rect.top;
pDraw->setRect(wrect);
pDraw->Draw(&canvas, false);
// uncomment the following line to print in colour! :)
// SetTextColor( hPrinter, 0x0000FF );
// finish the first page
EndPage( hPrinter );
// end this document and release the printer's DC
EndDoc( hPrinter );
//DeleteDC( hPrinter );
return true;
}
开发者ID:Unitrunker,项目名称:Tile,代码行数:49,代码来源:Printer.cpp
示例12: EndDocument
/*****************************************************************************
End document
Done on PRINT CLOSE
*****************************************************************************/
static void EndDocument(void)
{
DeleteObject( SelectObject( pd.hDC, hOldFont ) );
if (defaultprinter)
{
EndPage( pd.hDC );
EndDoc( pd.hDC );
}
else
{
EndPagePrinter( hPrinter );
EndDocPrinter( hPrinter );
}
documentON = FALSE;
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:19,代码来源:print.c
示例13: GPdestroywidget
int GPdestroywidget (Gwidget_t *widget) {
HENHMETAFILE mfile;
if (WPU->mode == 1) {
mfile = CloseEnhMetaFile (GC);
OpenClipboard (NULL);
EmptyClipboard ();
SetClipboardData (CF_ENHMETAFILE, mfile);
CloseClipboard ();
DeleteMetaFile (mfile);
} else {
EndPage (GC);
EndDoc (GC);
}
return 0;
}
开发者ID:AhmedAMohamed,项目名称:graphviz,代码行数:16,代码来源:gpcanvas.c
示例14: endPaint
void MacPrinterCanvas::finish() {
if (!hdc) {return;}
endPaint();
//if (!Escape(hdc, NEWFRAME, 0, NULL, NULL)) {
//DebugMessage("NEWFRAME failed\n");
// abort();
//}
//if (!Escape(hdc, ENDDOC, 0, NULL, NULL)) {
//DebugMessage("ENDDOC failed\n");
// abort();
//}
EndPage(hdc);
EndDoc(hdc);
DeleteDC(hdc);
hdc = 0;
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:16,代码来源:mprinter.cpp
示例15: apc_prn_end_doc
Bool
apc_prn_end_doc( Handle self)
{
apcErrClear;
objCheck false;
if ( EndPage( sys ps) < 0) apiPrnErr;
if ( EndDoc ( sys ps) < 0) apiPrnErr;
hwnd_leave_paint( self);
if ( sys pal) DeleteObject( sys pal);
DeleteDC( sys ps);
sys pal = nil;
sys ps = nil;
return apcError == errOk;
}
开发者ID:Absolight,项目名称:Prima,代码行数:16,代码来源:dev.c
示例16: Kill
static void Kill(Engine *engine)
{
PSEngine *psEngine= (PSEngine *)engine;
long fonts= psEngine->fonts;
int i, xll, yll, xur, yur;
int bad= 0;
if (psEngine->e.marked) bad= EndPage(psEngine);
if (psEngine->file) {
if (!bad) bad= PutLine(psEngine);
if (!bad) bad= Append(psEngine, "%%Trailer");
if (!bad) bad= PutLine(psEngine);
sprintf(line, "%%%%Pages: %d", psEngine->currentPage-1);
if (!bad) bad= Append(psEngine, line);
if (!bad) bad= PutLine(psEngine);
xll= psEngine->docBB.xll;
xur= psEngine->docBB.xur;
if (xll < xur) {
yll= psEngine->docBB.yll;
yur= psEngine->docBB.yur;
} else {
xll= yll= 0;
xur= 612;
yur= 792;
}
sprintf(line, "%%%%BoundingBox: %d %d %d %d", xll, yll, xur, yur);
if (!bad) bad= Append(psEngine, line);
if (!bad) bad= PutLine(psEngine);
strcpy(line, "%%DocumentFonts: ");
for (i=0 ; i<N_PSFONTS ; i++) {
if ((1<<i) & fonts) {
strcat(line, psFontNames[i]);
if (!bad) bad= Append(psEngine, line);
if (!bad) bad= PutLine(psEngine);
strcpy(line, "%%+ ");
}
}
if (psEngine->file!=pf_stdout) p_fclose(psEngine->file);
}
GpDelEngine(engine);
}
开发者ID:MattWherry,项目名称:yorick,代码行数:46,代码来源:ps.c
示例17: NextPage
/*****************************************************************************
* Go to next page
*****************************************************************************/
static void NextPage( void )
{
DeleteObject( SelectObject( pd.hDC, hOldFont ) );
if (defaultprinter)
{
EndPage( pd.hDC );
StartPage( pd.hDC );
}
else
{
EndPagePrinter( hPrinter );
StartPagePrinter( hPrinter );
}
hOldFont = SetFont( );
PrepareDC( );
column = row = 0;
page++;
PageHeader( page+1 );
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:22,代码来源:print.c
示例18: EndPrinting
void EndPrinting ( void )
{
if ( pd.hDC )
{
int nError = EndPage(pd.hDC);
if (nError <= 0)
{
DeleteDC ( pd.hDC );
pd.hDC = NULL;
return;
}
// end printing
EndDoc(pd.hDC);
// Delete DC when done.
DeleteDC ( pd.hDC );
pd.hDC = NULL;
}
}
开发者ID:Fliper12,项目名称:darkbasicpro,代码行数:20,代码来源:GUIDialogs.cpp
示例19: EndPage
void Fl_Gdi::page(double pw, double ph, int orientation)
{
if(nPages)
EndPage(gc_);
nPages++;
pw_=pw;
ph_=ph;
orientation_ = orientation;
DEVMODE * mode = (DEVMODE *)GlobalLock(mode_);
if(orientation)
mode->dmOrientation = DMORIENT_PORTRAIT;
else
mode->dmOrientation = DMORIENT_LANDSCAPE;
mode->dmPaperWidth = (int) (pw*254/72);
mode->dmPaperLength = (int) (ph*254/72);
mode->dmFields |= DM_PAPERLENGTH | DM_PAPERWIDTH;
mode->dmFields &= ~DM_PAPERSIZE;
GlobalUnlock(mode_);
set_page(1);
};
开发者ID:GustavoMOG,项目名称:efltk,代码行数:20,代码来源:Fl_Gdi.cpp
示例20: gdi_done
/*
* Finish the GDI print-out and clean up the data structures.
*/
static int
gdi_done(const char **fail)
{
int rc = 0;
if (pstate.out_row) {
if (EndPage(pstate.dlg.hDC) <= 0) {
*fail = "EndPage failed";
rc = -1;
}
pstate.out_row = 0;
}
if (EndDoc(pstate.dlg.hDC) <= 0) {
*fail = "EndDoc failed";
rc = -1;
}
cleanup_fonts();
return rc;
}
开发者ID:Oxyoptia,项目名称:x3270,代码行数:24,代码来源:gdi_print.c
注:本文中的EndPage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论