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
 TIEBitmap.DrawToTIEBitmap bug
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

nwscomps

185 Posts

Posted - Sep 09 2016 :  14:50:29  Show Profile  Reply
Using Imageen 6.3.2 , Delphi 10.1 Berlin

procedure Test(theBmp:TIEBitmap);
var
  aIERect: TIERectangle;
  tdIEBitmap : TIEBitmap;
begin
  theBmp.PixelFormat := ie8g; //with ie24rgb it works fine

  tdIEBitmap := TIEBitmap.Create(theBmp, rect(0,0, thebmp.width-1, 200)); //this is created correctly

  aIERect.x := 0;
  aIERect.y := 50;
  aIERect.width := theBmp.Width;
  aIERect.height := 100;

  try 
    tdIEBitmap.DrawToCanvas(thebmp.Canvas, 0, 200); //this works
    
    //Wrong result if set pixel format to 8 bits!!!
    // bitmap will appear all stretched out
    tdIEBitmap.DrawToTIEBitmap(theBmp, 0, 400); //this does not work for ie8g
    
  finally
    tdIEBitmap.free;
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenImageEnDialog1.Execute then
   begin
     ImageEnView1.IO.LoadFromFile(OpenImageEnDialog1.FileName);
     Test(ImageEnView1.IEBitmap);
     imageenview1.Fit;
   end;
end;

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library

xequte

38616 Posts

Posted - Sep 12 2016 :  20:00:20  Show Profile  Reply
Hi Francesco

Unfortunately DrawToTIEBitmap only supports ie24RGB (because it is based on RenderToTIEBitmapEx). We've updated the documentation to reflect this.

There are other ways to copy among bitmaps, like TIEBitmap.AssignRect and TIEBitmap.CopyRectTo, which supports all pixel formats.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

nwscomps

185 Posts

Posted - Sep 15 2016 :  07:01:34  Show Profile  Reply
Thanks.

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: