C/Visual C - Imprimir Bitmap Visual C++

 
Vista:

Imprimir Bitmap Visual C++

Publicado por Raul (1 intervención) el 12/09/2003 19:44:27
Podría alguien ayudarme para imprimir un Bitmap.

El codigo utilizado es:

HBITMAP hBitmap;
CBitmap Bitmap;
BITMAP bm;
HDC mDC;

//Siendo hDCImp ->handle al contexto de la impresora

hBitmap=(HBITMAP)LoadImage(NULL,"Bitmap.bmp",IMAGE_BITMAP,0,0,LR_DEFAULTSIZE | LR_LOADFROMFILE);

//Pasa a Bitmap
Bitmap.Attach(hBitmap);
Bitmap.GetBitmap(&bm);

//Carga en memoria
mDC=CreateCompatibleDC(hDCImp);

SelectObject(mDC,hBitmap);

BitBlt(hDCImp,Pos.x,Pos.y,bm.bmWidth,bm.bmHeight,mDC,0,0,SRCCOPY);

DeleteObject(hBitmap);

DeleteDC(mDC);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Visualizar imagen jpg

Publicado por RiHeMa (2 intervenciones) el 14/09/2003 20:06:03
Queria saber si tu sabes como abrir una imagen jpg o bmp desde un archivo y visualizarla en una caja de imagen (CStatic) en MFC.

Gracias por adelantado
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar