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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Demo ImageEnMView_DD

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
John Posted - Mar 11 2016 : 18:02:58
Hello

If I place an ImageEnView1 component on the demo main form, I can capture the file name of a selected image from the ImageEnMView1 component via the ImageEnMView1.OnSelectImage event. I can then load the selected image into the ImageEnView1 component with the following two lines of code

ImageEnView1.Clear
ImageEnView1.IO.LoadFromFile(ImageEnMView1.ImageFileName[idx]);

However, If I drag the image from the ImageEnMView1 to ImageEnMView2 and then try to select the image from the ImageEnMView2 component and load the selected image into the ImageEnView1 component, the file name is not captured and the image is not loaded. see below

ImageEnView1.Clear;
ImageEnView1.IO.LoadFromFile(ImageEnMView2.ImageFileName


Any help would be greatly appreciated.

John
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Mar 11 2016 : 18:27:04
Use the ImageEnMView1.MIO.Params[idx].FileName property instead of the ImageFileName[idx]) then in the ImageEnMView2DragDrop event copy theImageEnMView1.MIO.Params[idx].filename to
ImageEnMView2.MIO.Params[im].FileName;

procedure TForm1.ImageEnMView2DragDrop(Sender, Source: TObject; X,
  Y: Integer);
var
  i: integer;
  idx, im: integer;
  tmpbmp: TBitmap;
begin
  im := ImageEnMView2.InsertingPoint(X, Y);
  for i := 0 to ImageEnMView1.MultiSelectedImagesCount - 1 do
  begin
    idx := ImageEnMView1.MultiSelectedImages[i];
    tmpbmp := ImageEnMView1.GetBitmap(idx);

    ImageEnMView2.InsertImage(im);
    ImageEnMView2.SetImage(im, tmpbmp);
    ImageEnMView2.MIO.Params[im].FileName := ImageEnMView1.MIO.Params[idx].FileName;
    inc(im);

    ImageEnMView1.ReleaseBitmap(idx);
  end;
end;

After the drop the ImageEnMView1.MIO.Params[idx].FileName and the ImageEnMView2.MIO.Params[idx].FileName will be the same for each.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development