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
 CopyObjectsToBack BUG
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graphman

259 Posts

Posted - Apr 22 2013 :  17:24:50  Show Profile  Reply
New bug with
ImageEnView1->CopyObjectsToBack(true, true, false)

after this command all image object are stretched

With
ImageEnView1->CopyObjectsToBack(true, true, true) - all is OK

w2m

USA
1990 Posts

Posted - Apr 23 2013 :  06:57:59  Show Profile  Reply
I tried to duplicate your bug report, but was unable to do so.
I see no stretching with either call.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

graphman

259 Posts

Posted - Apr 23 2013 :  07:38:33  Show Profile  Reply
Have you inserted an image object?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 23 2013 :  08:07:40  Show Profile  Reply
Yes... a Bitmap object... ImageEnVect1.MouseInteractVt := [miPutBitmap];

William Miller
Go to Top of Page

fab

1310 Posts

Posted - Apr 23 2013 :  23:04:52  Show Profile  Reply
I still cannot replicate using image objects:

ImageEnVect1.SetObjBitmapFromFile(-1, 'test.jpg');
ImageEnVect1.ObjKind[-1] := iekBitmap;
ImageEnVect1.SetObjRect(-1, Rect(10, 10, 100, 100));
ImageEnVect1.AddNewObject();
ImageEnVect1.CopyObjectsToBack(true, true, false);
ImageEnVect1.RemoveAllObjects();

Still assume ImageEnVect1.Bitmap has ie24RGB pixel format.
Go to Top of Page

graphman

259 Posts

Posted - Apr 24 2013 :  03:50:01  Show Profile  Reply
> Still assume ImageEnVect1.Bitmap has ie24RGB pixel format.

No. Background is black-and-white
Reason to use
CopyObjectsToBack(true, true, FALSE);
is to prevent image converting to 24 bit at combining
Go to Top of Page

graphman

259 Posts

Posted - Apr 24 2013 :  05:37:57  Show Profile  Reply
my test
=======

file.tif is there
http://www.graphicregion.com/file.tif


//---------------------------------------------------------------------------
void __fastcall TForm1::ButtonOpenFileClick(TObject *Sender)
{
ImageEnVect1->IO->LoadFromFile("file.tif");
ImageEnVect1->IO->Params->ImagingAnnot->CopyToTImageEnVect(ImageEnVect1);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ButtonCopyToBackClick(TObject *Sender)
{
ImageEnVect1->CopyObjectsToBack(true, true, false);
ImageEnVect1->RemoveAllObjects();
}
//---------------------------------------------------------------------------
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 24 2013 :  08:28:57  Show Profile  Reply
I am sure Fabrizio will have more to say about this but here is my comment:

I do not think TIF file can be 32-bit with ImageEn. TIF files support 1- to 24-bit. Anyways... when I create my own tif file and CopyObjectsToBack the result is what you would expect. When I load the objects from the tif file with ImageEnVect1.IO.Params.ImagingAnnot.CopyToTImageEnVect(ImageEnVect1) then I CopyObjectsToBack with your tif file I get an unexpected result.

Unexpected Result:

5.67 KB

When I save my Tif file with:
procedure TForm1.Button3Click(Sender: TObject);
begin
  // save the image
  ImageEnVect1.IO.SaveToFile('output.tif');
  // save the objects
  ImageEnVect1.SaveObjectsToTIFF('output.tif',0);
end;

I get this:

17.57 KB
Then I load my TIF file with:
procedure TForm1.Button1Click(Sender: TObject);
begin
  // load the image
  ImageEnVect1.IO.LoadFromFile('output.tif');
  // load the objects
  ImageEnVect1.LoadObjectsFromTIFF('output.tif',0);
end;


I get this:

17.57 KB
When I merge the objects with my TIF file with this:
procedure TForm1.Button2Click(Sender: TObject);
begin
  ImageEnVect1.CopyObjectsToBack(true, true, false);
  ImageEnVect1.RemoveAllObjects();
end;


I get this:

15.53 KB

I do not have much experience with ImageEnVect1.IO.Params.ImagingAnnot.CopyToTImageEnVect(ImageEnVect1) because I seldom, if ever used this method. Maybe Fabrizio can explain what is occurring with CopyToTImageEnVect. Meanwhile... if you save and load the objects like I demonstrated, then CopyObjectsToBack works perfectly.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

graphman

259 Posts

Posted - Apr 24 2013 :  09:16:47  Show Profile  Reply
> I do not think TIF file can be 32-bit with ImageEn.

Where do you see 32-bit TIF file?

My file is 1-bit, image object - 24-bit
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 24 2013 :  09:20:26  Show Profile  Reply
My error <GRIN>. Do you get the same result that I got with your tif file?

William Miller
Go to Top of Page

graphman

259 Posts

Posted - Apr 24 2013 :  11:59:09  Show Profile  Reply
I need to get right result without saving and opening.
Go to Top of Page

fab

1310 Posts

Posted - Apr 25 2013 :  00:09:30  Show Profile  Reply
Thank you, now I can replicate.
Please wait for a fix.
Go to Top of Page

graphman

259 Posts

Posted - Apr 25 2013 :  03:21:55  Show Profile  Reply
thanks
Go to Top of Page

fab

1310 Posts

Posted - Apr 25 2013 :  06:04:18  Show Profile  Reply
Ok, a fix will be available on next minor release. Write to support to get a developing release now (which has the fix included).

This fix handles the case where an RGB image (your object embedded as wang annotation) must be rendered on a black/white image. Of course the RGB image is converted to B/W (losing, as in this case, its antialiasing). Following is the resulting output after CopyObjectsToBack:


Go to Top of Page

graphman

259 Posts

Posted - Apr 25 2013 :  08:06:23  Show Profile  Reply
thanks
Go to Top of Page

graphman

259 Posts

Posted - May 30 2013 :  02:39:45  Show Profile  Reply
We tested your new release and we found another fault.

I try explain to you what we do.

1) Cut out part of bitmap.

2) Paste this cut out to other place.

3) Insert new annotation (any).

4) Combine all annotations with background.

After that drawing is damaged.
Go to Top of Page

fab

1310 Posts

Posted - Jun 05 2013 :  07:01:46  Show Profile  Reply
Waiting for a fix this topic continues here:

http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1105#
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: