 |
Club Builder Foro de C++Builder en español
|
| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
_Willa Capt


Registrado: 28 Ago 2002Mensajes: 169Ubicación: Madrid ( España )
|
Publicado: Lun 10 Abr, 2006 8:43 pm Asunto: Determinar la calidad de Impresión!! |
|
|
Buenas,
Llevo rato buscando alguna forma de determinar a la hora
de imprimir la calidad del ppp (puntos por pulgada ), he comprobado
que determinadas impresoras se puede seleccionar este dato ..., que dependiendo la calidad de impresión "Normal" asigna 600ppt y "borrador" asigna 300ppt:) .
Me gustaria saber si esto mismo se puede hacer ... con código.
Un Saludo.
_Willa _________________ Saludos
~~~~~~~~
_Willa
~~~~~~~~
www.avancegame.com |
|
| Volver arriba |
|
 |
Cesar C. Salazar Gonzalez Master


Registrado: 01 Oct 2002Mensajes: 2155Ubicación: San Cristóbal de Las Casas, Chiapas
|
Publicado: Mie 12 Abr, 2006 6:36 am Asunto: |
|
|
Existe una estructura de nombre PRINTER_DEFAULTS, que te permite definir las caracteristicas en cada una de ellas
puedes ubicar el proceso de impresion, en relativa, lo unico que puede modificarse es la opcion
pDevMode
de la siguiente pagina de Microsoft MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_9p4i.asp
en esta otra pagina exiten los datos de la estructura DEVMODE, en la cual dentro de la union vas a encontrar un parametro dmPrintQuality con las siguientes respuestas cuando presionas click sobre el
| Cita: | dmPrintQuality
Specifies the printer resolution. There are four predefined device-independent values:
DMRES_HIGH
DMRES_MEDIUM
DMRES_LOW
DMRES_DRAFT
If a positive value is specified, it specifies the number of dots per inch (DPI) and is therefore device dependent. |
algo asi como este ejemplo
| Código: | #include <printers.hpp>
void __fastcall TForm1::FormShow(TObject *Sender)
{
TPrinter *pPrinter = Printer();
HANDLE hPrinter = NULL;
PRINTER_DEFAULTS PD;
TCHAR sdata[200];
PD.pDatatype = sdata;
PD.pDevMode = NULL;
PD.DesiredAccess = PRINTER_ACCESS_USE;
//-----------------------------------------------------------
//Leave the printer description(name) only slicing off its remainder str.
//There could be other decent ways in getting only the printer description(name) than this...
int idrive = pPrinter->Printers->Strings[pPrinter->PrinterIndex].Length();
TCHAR *sdrive = new TCHAR[idrive + 0x01];
strcpy(sdrive, pPrinter->Printers->Strings[pPrinter->PrinterIndex].c_str());
TCHAR *p = strstr(sdrive, " o");
if (p == NULL) p = strstr(sdrive, " O");
if (p == NULL) {delete []sdrive; return;}
if (*(p + 0x02) == 'n' || *(p + 0x02) == 'N')
*p = '\0';
// Now the sdrive retains the current printer description(name).
//-----------------------------------------------------------
AnsiString aResult = "Failed!";
try
{
if (::OpenPrinter(sdrive, &hPrinter, &PD))
{
aResult = "Opened : ";
try
{
DRIVER_INFO_2 di;
DWORD idi = sizeof(di);
::GetPrinterDriver(hPrinter, NULL, 0x02, NULL, idi, &idi);
//Always returns false here, no matter what the result may be.
//What matters of the result is the idi only here, not its return value...
if (idi > 0x00)
{
di.pName = new TCHAR[idi + 0x01];
try
{
//Calls the function once more here for desired data now.
if (::GetPrinterDriver(hPrinter, NULL, 0x02, (LPBYTE)&di, idi, &idi))
{
aResult += "Got the current printer driver (OK)!"; //FYI
ListBox1->Items->Add("-------------------------------------");//FYI
ListBox1->Items->Add(AnsiString("Current Printer : ") + di.pName);
}
else
{
aResult += "Failed getting the current prnter driver!"; //FYI
ShowMessage(IntToStr(GetLastError()));
}
}
__finally {delete []di.pName;}
}
}
__finally
{
::ClosePrinter(hPrinter);
}
Caption = aResult; //FYI
}
else Caption = "OpenPrinter function failed."; //FYI
}
__finally {delete []sdrive;}
}
|
sacado de la siguiente pagina, http://www.geocities.jp/keynes77jp/tips.htm
Espero resuelva tu problema...
saludos _________________
 |
|
| Volver arriba |
|
 |
_Willa Capt


Registrado: 28 Ago 2002Mensajes: 169Ubicación: Madrid ( España )
|
Publicado: Mie 12 Abr, 2006 4:07 pm Asunto: |
|
|
Ok, Cesar, es justo lo que necesitaba,
Estuve observando esta misma estructura, pero no cai en esos tipos
Un Abrazo. _________________ Saludos
~~~~~~~~
_Willa
~~~~~~~~
www.avancegame.com |
|
| Volver arriba |
|
 |
|
|
No puedes publicar temas nuevos en este foro No puedes responder a temas en este foro No puedes editar tus mensajes en este foro No puedes borrar tus mensajes en este foro No puedes votar en las encuestas de este foro
|
© 2002–2026 Club Builder · Funciona con phpBB.
|