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
 TImageEnVect bug ?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

cleidsonbsilva

Brazil
3 Posts

Posted - Jan 27 2014 :  18:14:29  Show Profile  Reply
Hi Guys,

Im putting a linelabel to the image, but when I use a command copyobjectstoback the text from linelabel disappear. Only the line is copied to image.
I also make the tests in imageen demo applications and the problem is ocurring too.

Anyone can help me ?

w2m

USA
1990 Posts

Posted - Jan 28 2014 :  11:10:10  Show Profile  Reply
This may be a small bug with linelabel... because I can duplicate the problem here by merging the selected linelabel object or by merging all objects. Yet, merging a text object works just fine.

procedure TForm1.MergeSelectedObjects1Click(Sender: TObject);
{ MergeSelectedObjects. }
var
  i: Integer;
  ihObj: Integer;
begin
  ImageEnVect1.ObjSaveUndo;
  { Remove the selected object }
  for i := ImageEnVect1.ObjectsCount - 1 downto 0 do
  begin
    ihObj := ImageEnVect1.GetObjFromIndex(i);
    if ImageEnVect1.IsSelObject(ihObj) then
    begin
      { Merge vectorial objects with the background image }
      ImageEnVect1.CopyObjectToBack(ihObj, True, True);
      ImageEnVect1.UnSelObject(ihObj);
      { Remove the object }
      ImageEnVect1.RemoveObject(ihObj);
      { Deselect hobj object }
      ImageEnVect1.UnSelObject(ihObj);
      { Remove the object from the ListView }
      ListViewObjects1.Items[i].Delete;
    end;
    Break;
  end;
end;

procedure TForm1.MergeAllObjects1Click(Sender: TObject);
{ MergeAllObjects. }
begin
  if ImageEnVect1.ObjectsCount > 0 then
  begin
    ImageEnVect1.Proc.SaveUndo;
    { Merge vectorial objects with the background image }
    ImageEnVect1.CopyObjectsToBack(Antialias1.Checked,
      AdaptBitmapPixelFormat1.Checked);
    ImageEnVect1.RemoveAllObjects;
    ImageEnVect1.Update;
  end;
end;

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

xequte

39053 Posts

Posted - Feb 03 2014 :  13:37:56  Show Profile  Reply
Hi

Thanks, we've found the problem and resolved it for v5.0.6.

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

w2m

USA
1990 Posts

Posted - Feb 03 2014 :  13:52:29  Show Profile  Reply
Nigel,

I think we found another small bug with TImageEnVect.

procedure TForm1.ObjPaste1Click(Sender: TObject);
{ Paste1Click. }
begin
  ImageEnVect1.UnSelAllObjects;
  ImageEnVect1.ObjPasteFromClipboard(5, 5); 
end;

Without preceding ObjPasteFromClipboard with UnSelAllObjects an exception is produced.

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

xequte

39053 Posts

Posted - Feb 05 2014 :  02:33:45  Show Profile  Reply
Hi Bill

I can't reproduce this. Can you give me more information?



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

w2m

USA
1990 Posts

Posted - Feb 05 2014 :  05:36:57  Show Profile  Reply
I forgot to include that an object must be selected or there is no problem. If you select an object, then paste the exception takes place.

William Miller
Go to Top of Page

xequte

39053 Posts

Posted - Feb 06 2014 :  20:36:49  Show Profile  Reply
Hi William

Sorry I'm still not encountering an error. What version of Delphi is this on? 32 or 64bit compiliation? Does it matter what is on the clipboard at the time?




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

w2m

USA
1990 Posts

Posted - Feb 07 2014 :  07:15:59  Show Profile  Reply
Nigel,

This is a strange bug, but it definitely exists, at least here and on another users system. Another user who uses an older version of ImageEn reported he got an exception when pasting an object to me. When I followed up here I got the exception as well.

I tested Win32 or Win64 and both produce the exception. When the exception occurs there is an vectorial object in the clipboard because that is what copied immediately before the paste.

A test with a very simple demo does not produce the exception, but paste does not work at all... meaning no object is visible after the paste.

A MadExcept error log shows that when the exception occurs the line that causes the exception is TImageEnVect.ObjPasteFromClipboard.

Delphi XE4
Windows 8.1
ImageEn 5.0.5

To test this further I made a very simple demo. With the simple demo I do not get an exception when pasting, but if an object is selected before pasting, the object is not pasted (is not visible) and there are no error messages or exceptions. If I unselect all objects before the call to paste, then everything works as expected.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls,
  imageenview, ieview, ievect;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    ImageEnVect1: TImageEnVect;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    CheckBox1: TCheckBox;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  ImageEnVect1.ObjKind[IEV_NEXT_INSERTED_OBJECT] := iekBOX;
  ImageEnVect1.SetObjRect(IEV_NEXT_INSERTED_OBJECT, Rect(10, 10, 100, 100));
  ImageEnVect1.ObjPenColor[IEV_NEXT_INSERTED_OBJECT] := clRed;
  ImageEnVect1.ObjBrushColor[IEV_NEXT_INSERTED_OBJECT] := clRed;
  ImageEnVect1.ObjBrushStyle[IEV_NEXT_INSERTED_OBJECT] := bsSolid;
  ImageEnVect1.AddNewObject;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ImageEnVect1.ObjCopyToClipboard;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  if CheckBox1.Checked then
     ImageEnVect1.UnSelAllObjects;
  ImageEnVect1.ObjPasteFromClipboard(0,0);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  ImageEnVect1.MouseInteractVt := [miObjectSelect];
end;

end.


I do not know what is wrong but something is for sure. A MadExcept error log for the demos that produce the exception is shown below.

date/time : 2014-02-07, 08:38:20, 653ms
computer name : DEVELOP
user name : w2miller
registered owner : Windows User
operating system : Windows 8 Tablet PC x64 build 9200
system language : English
system up time : 39 minutes 33 seconds
program up time : 17 seconds
processors : 8x Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
physical memory : 20079/24526 MB (free/total)
free disk space : (C:) 144.13 GB (D:) 1829.88 GB
display mode : 1920x1080, 32 bit
process id : $1e54
allocated memory : 80.92 MB
executable : ImageEnVectorial.exe
exec. date/time : 2014-02-07 08:30
version : 1.0.0.0
compiled with : Delphi XE4
madExcept version : 4.0.7
contact name : w2m
contact email : w2m@frontiernet.net
callstack crc : $a594c2ae, $98db443e, $98db443e
exception number : 1
exception class : EOutOfMemory
exception message : Out of memory.

main thread ($228c):
00990609 +2b9 ImageEnVectorial.exe ievect 8896 +69 TImageEnVect.ReadObj
00996754 +100 ImageEnVectorial.exe ievect 11673 +24 TImageEnVect.ObjPasteFromClipboard
009dd268 +044 ImageEnVectorial.exe Unit1 7830 +2 TForm1.ObjPaste1Click
0066c9f6 +0aa ImageEnVectorial.exe Vcl.Menus 2523 +19 TMenuItem.Click
0066e03f +013 ImageEnVectorial.exe Vcl.Menus 3436 +5 TMenu.DispatchCommand
00680387 +01f ImageEnVectorial.exe Vcl.Forms 6153 +2 TCustomForm.WMCommand
0059da29 +2bd ImageEnVectorial.exe Vcl.Controls 7224 +91 TControl.WndProc
005a24e5 +5c5 ImageEnVectorial.exe Vcl.Controls 10039 +153 TWinControl.WndProc
0067d1ad +60d ImageEnVectorial.exe Vcl.Forms 4388 +201 TCustomForm.WndProc
005a1b28 +02c ImageEnVectorial.exe Vcl.Controls 9751 +3 TWinControl.MainWndProc
0053c164 +014 ImageEnVectorial.exe System.Classes 16860 +8 StdWndProc
76839c3b +00b user32.dll DispatchMessageW
0068683b +0f3 ImageEnVectorial.exe Vcl.Forms 10288 +23 TApplication.ProcessMessage
0068687e +00a ImageEnVectorial.exe Vcl.Forms 10318 +1 TApplication.HandleMessage
00686bb9 +0c9 ImageEnVectorial.exe Vcl.Forms 10456 +26 TApplication.Run
009e99f8 +064 ImageEnVectorial.exe ImageEnVectorial 22 +5 initialization
7757495b +00c KERNEL32.DLL BaseThreadInitThunk

thread $1e40:
7757495b +c KERNEL32.DLL BaseThreadInitThunk

thread $274c:
7757495b +c KERNEL32.DLL BaseThreadInitThunk

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

xequte

39053 Posts

Posted - Feb 08 2014 :  12:25:00  Show Profile  Reply
Hi Bill

If I select the object after clicking Button1, then copy and paste works as expected in v5.0.6 beta. I suspect you are seeing memory issue that we fixed in our earlier v5.0.6 work. V5.0.6 will be ready before too long.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: