mastintin wrote:Enrico Maria Giordano wrote:On XP and Vista your sample shows a black rectangle.
EMG
https://support.microsoft.com/es-es/kb/958911
Ok, thank you.
EMG
mastintin wrote:Enrico Maria Giordano wrote:On XP and Vista your sample shows a black rectangle.
EMG
https://support.microsoft.com/es-es/kb/958911
Enrico Maria Giordano wrote:mastintin wrote:Enrico Maria Giordano wrote:On XP and Vista your sample shows a black rectangle.
EMG
https://support.microsoft.com/es-es/kb/958911
Ok, thank you.
EMG
It works!!! ![]()
EMG
Bitmap* newImage = new Bitmap( nWidth, nHeight, PixelFormat32bppPARGB ) ; // cambio aqui ---- original->GetPixelFormat() );nageswaragunupudi wrote:Mr Manuel
Bitmap* newImage = new Bitmap( nWidth, nHeight, PixelFormat32bppPARGB ) ; // cambio aqui ---- original->GetPixelFormat() );
This is the change you made. That means this function adopts "PixelFormat32bppPARGB" for "all" image/bitmap files, irrespective of the source and present pixelformat.
Does it have any side effects on other file formats?
One of the cases I can now recollect is non-alpha bmp files.
The hBitmap returned is an alpha bmp. We get into problem while rendering.
I confirm. All images loaded with GDI+ are "marked" as alphachannel even if they are not.
EMG
nageswaragunupudi wrote:One of the cases I can now recollect is non-alpha bmp files.
The hBitmap returned is an alpha bmp. We get into problem while rendering.
Any news? ![]()
EMG
.....
int nWidth = original->GetWidth() ;
int nHeight = original->GetHeight() ;
PixelFormat pf ;
if( strncmp( adr, "GIF", 3 ) != 0 ) // detect if file is a gif type.
pf = original->GetPixelFormat();
else
pf = PixelFormat32bppPARGB ;
Bitmap* newImage = new Bitmap( nWidth, nHeight, pf ) ;
Graphics * graphics = new Graphics( newImage );
.....Mr Manuel
So your proposal is to force 32bppPARGB for GIFs.
Done it.
I'm ready to test it. ![]()
EMG
nageswaragunupudi wrote:Mr Manuel
So your proposal is to force 32bppPARGB for GIFs.
Done it.
.......
PixelFormat pf ;
   pf = original->GetPixelFormat();
Â
bool l32bpp = hb_parl( 2) Â
 if (  ( strncmp( adr, "GIF", 3 ) == 0  )  &  ( l32bpp == TRUE )  )
      pf = PixelFormat32bppPARGB ;
 Â
 Bitmap* newImage  = new Bitmap( nWidth, nHeight, pf ) ;
........Enrico . For your test ...
https://dl.dropboxusercontent.com/u/132931/gdiplus.obj
Cheers.
Probably I'm doing something wrong but it doesn't work (GIFs are still bad rendered).
EMG