ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PixelFormat convert
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

quantuz

Sweden
55 Posts

Posted - Nov 13 2012 :  16:56:50  Show Profile  Reply
Hi!
The conversion between ie8p and ie16g dont seems to work.
The result as an all black image.
the source image is a .bmp palette image
iEBitmapPtr_ = new TIEBitmap();
aviIEIO_->AttachedIEBitmap = iEBitmapPtr_;
aviIEIO_->LoadFromFile(fileName); // iEBitmapPtr_ is here ie8p
iEBitmapPtr_->PixelFormat = ie16g;
// now iEBitmapPtr_ is here ie16g but all black

Running BCB XE2 and IE 4.1.0

Best Regards,
//Christer

fab

1310 Posts

Posted - Nov 14 2012 :  12:31:43  Show Profile  Reply
Hi,
I tried this with the latest version. It seems to work.
Anyway please could you send a sample 8 bit image?
Go to Top of Page

quantuz

Sweden
55 Posts

Posted - Nov 14 2012 :  15:55:25  Show Profile  Reply
Hi Fabrizio,

Tanks fo the help, here is the bitmap..
Here is the complete code sequence

iEBitmapPtr_ = new TIEBitmap();
iEBitmapPtr_->BitAlignment=256;
iEBitmapPtr_->MemoryAllocator = iemaVCL;
aviIEIO_->NativePixelFormat = true;
aviIEIO_->AttachedIEBitmap = iEBitmapPtr_;
iEBitmapPtr_->BitAlignment=256;
aviIEIO_->LoadFromFile(2star.bmp);
iEBitmapPtr_->BitAlignment=256;
iEBitmapPtr_->PixelFormat = ie16g;

Gegards,
//Christer


65.44 KB
Go to Top of Page

fab

1310 Posts

Posted - Nov 14 2012 :  23:19:52  Show Profile  Reply
Please let me know you display the image (how display iEBitmapPtr_). This works:

ImageEnView1->LegacyBitmap = false;
ImageEnView1->IO->NativePixelFormat = true;
ImageEnView1->IEBitmap->BitAlignment = 256;
ImageEnView1->IO->LoadFromFile("20121114154624_2stars.bmp");
ImageEnView1->IEBitmap->BitAlignment = 256;
ImageEnView1->IEBitmap->PixelFormat = ie16g;
ImageEnView1->Update();
Go to Top of Page

quantuz

Sweden
55 Posts

Posted - Nov 16 2012 :  02:46:15  Show Profile  Reply
Hi Fabrizio,

I display the image in a ImageEnVect with the code below
ImageEnView1->SetExternalBitmap(iEBitmapPtr_)

Best Regards,
//Christer
Go to Top of Page

fab

1310 Posts

Posted - Nov 22 2012 :  00:49:27  Show Profile  Reply
Hi Christer,
this is a bug of ImageEn, when setting BitAlignment (<>32) with color-mapped images. This bug will big fixed in next minor release.
A workaround is to convert the image to ie8g before last BitAlignment = 256:

ImageEnView1->IO->LoadFromFile("20121114154624_2stars.bmp");
ImageEnView1->IEBitmap->PixelFormat = ie8g;
ImageEnView1->IEBitmap->BitAlignment = 256;
ImageEnView1->IEBitmap->PixelFormat = ie16g;

It doesn't cause loss of information, because ie8g and ie8p are both 8 bit.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: