dea  | Et oui, alors qu'avec le code ci dessous j'arrive a afficher une image transparente (LPPICTURE, interface IPICTURE) dans le contexte graphique courant (hdc), si je cree un DC memoire, l'image s'affiche bien, mais elle n'est plus transparente.
 Quelqu'un a t'il une idee a me soumettre pour resoudre le pb ????
  
  Code :
 - RECT*	Image::show( HDC hdc, int x = -1, int y = -1, int w = -1, int h = -1) {
 - 	OLE_XSIZE_HIMETRIC width;
 -  OLE_YSIZE_HIMETRIC height;
 - 	int l_x, l_y, l_w, l_h;
 - 	LPPICTURE  picture = getPicture();
 - 	//on cree un DC compatible bidon
 - 	HDC memDC	=	CreateCompatibleDC( hdc ) ;
 - 	picture->get_Width( &width );
 - 	picture->get_Height( &height );
 -  CSize sz( width, height );
 - 	CDC *dc = new CDC();
 - 	dc->Attach(memDC);
 -  dc->HIMETRICtoDP( &sz );
 - 	HBITMAP hBmp = CreateCompatibleBitmap(hdc, width, height);
 - 	HBITMAP oldBmp = (HBITMAP)SelectObject(memDC, hBmp);
 -  //La, ca fonctionne, mon image s'affiche en transparence
 -  picture->Render(	hdc,
 -                   0, 0,  // dest loc
 -                   sz.cx, sz.cy,   // destination size
 -                   0, height,  // source loc
 -                   width, -height, // source size
 -                   NULL );
 -  //La, elle s'affiche, mais avec du noir a la place de la transparence...
 -  picture->Render(	memDC,
 -                   0, 0,  // dest loc
 -                   sz.cx, sz.cy,   // destination size
 -                   0, height,  // source loc
 -                   width, -height, // source size
 -                   NULL );
 -  // on copie depuis le DC memoire dans le DC courant
 - 	BitBlt(	hdc, 0, 0, width, height, memDC, 0, 0, SRCCOPY ) ;
 
  |  
    Message édité par dea le 23-06-2003 à 14:11:36
  |