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
 How to draw multiple images besides each other

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
exchangeviews Posted - Jul 11 2015 : 05:52:12
Hello,

I am able to draw 2 images using following concept:
http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1530

But I need to draw multiple images of ImageEnMView besides each other. Looking for a way to combine each checked images only.

Any Idea?

Please assist.

Thanks in advance.
3   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jul 12 2015 : 13:09:13
This maximizes the dimensions of the drawn images. I am running the app maximized... windowstate := wsMaximized:
procedure TForm1.DrawHorzontally1Click(Sender: TObject);
var
  i: Integer;
  iIndex: Integer;
  iIEBitmapSource: TIEBitmap;
  iCheckedCounter: Integer;
  iBitmapSourceWidth: Integer;
  iBitmapSourceHeight: Integer;
begin
  Screen.Cursor := crHourGlass;
  try
    ImageEnView1.Clear;
    // Create a TIEbitmap to hold the source image
    iIEBitmapSource := TIEBitmap.Create;
    try
      iBitmapSourceWidth := ImageEnView1.ClientWidth - 350;//1024;
      iBitmapSourceHeight := ImageEnView1.ClientHeight; //768;
      // Set the ImageEnView IEBitmap width to iBitmapSourceWidth * the number of checked images
      ImageEnView1.IEBitmap.Width := iBitmapSourceWidth *
        VerticalImageEnMView1.CheckedCount;
      // Set the ImageEnView IEBitmap height
      ImageEnView1.IEBitmap.Height := iBitmapSourceHeight;
      { Initialize iCheckedCounter value so we know where to draw the checked image }
      iCheckedCounter := -1;
      // Get the checked images and draw them to the ImageEnView IEBitmap
      for i := 0 to VerticalImageEnMView1.ImageCount - 1 do
      begin
        if VerticalImageEnMView1.Checked[i] then
        begin
          { Set the iCheckedCounter value }
          Inc(iCheckedCounter);
          // Load input file
          VerticalImageEnMView1.CopyToIEBitmap(i, iIEBitmapSource);
          // Resize iIEBitmapSource
          iIEBitmapSource.Resample(iBitmapSourceWidth, -1);
          // Draw Source bitmap to ImageEnView Bitmap at the position of the
          // iBitmapSourceWidth * iCheckedCounter Value
          iIEBitmapSource.DrawToTIEBitmap(ImageEnView1.IEBitmap,
            iBitmapSourceWidth * iCheckedCounter, 0);
        end;
      end;
      // Update after drawing
      ImageEnView1.Update;
      // Free the iIEBitmapSource
    finally
      iIEBitmapSource.Free;
    end;
  finally
    Screen.Cursor := crDefault;
  end;
end;

I hope this fits your needs a little better.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
exchangeviews Posted - Jul 12 2015 : 12:45:37
Thanks Bill. I replaced iBitmapSourceHeight with iBitmapSourceWidth in DrawToTIEBitmap(..) function and it worked fine but the problem is that I am unable to preserve the max height between all images of imageenmview. Height is being 768 for each image. BTW..I am trying to fix it. If you have any solution, please assist.
w2m Posted - Jul 11 2015 : 09:56:04
Here is one way to draw checked images horizontally at a specified dimension.

uses imageenview, iemio, imageenproc, ieview, iemview, iexBitmaps, hyiedefs, hyieutils;
procedure TForm1.DrawHorzontally1Click(Sender: TObject);
var
  i: Integer;
  iIndex: Integer;
  iIEBitmapSource: TIEBitmap;
  iCheckedCounter: Integer;
  iBitmapSourceWidth: Integer;
  iBitmapSourceHeight: Integer;
begin
  Screen.Cursor := crHourGlass;
  try
    ImageEnView1.Clear;
    // Create a TIEbitmap to hold the source image
    iIEBitmapSource := TIEBitmap.Create;
    try
      iBitmapSourceWidth := 1024;
      iBitmapSourceHeight := 768;
      // Set the ImageEnView IEBitmap width to iBitmapSourceWidth * the number of checked images
      ImageEnView1.IEBitmap.Width := iBitmapSourceWidth *
        VerticalImageEnMView1.CheckedCount;
      // Set the ImageEnView IEBitmap height
      ImageEnView1.IEBitmap.Height := iBitmapSourceHeight;
      { Initialize iCheckedCounter value so we know where to draw the checked image }
      iCheckedCounter := -1;
      // Get the checked images and draw them to the ImageEnView IEBitmap
      for i := 0 to VerticalImageEnMView1.ImageCount - 1 do
      begin
        if VerticalImageEnMView1.Checked[i] then
        begin
          { Set the iCheckedCounter value }
          Inc(iCheckedCounter);
          // Load input file
          VerticalImageEnMView1.CopyToIEBitmap(i, iIEBitmapSource);
          // Resize iIEBitmapSource
          iIEBitmapSource.Resample(iBitmapSourceWidth, iBitmapSourceHeight,
            rfNone, True);
          // Draw Source bitmap to ImageEnView Bitmap at the position of the
          // iBitmapSourceHeight * iCheckedCounter Value
          iIEBitmapSource.DrawToTIEBitmap(ImageEnView1.IEBitmap,
            iBitmapSourceHeight * iCheckedCounter, 0);
        end;
      end;
      // Update after drawing
      ImageEnView1.Update;
      // Free the iIEBitmapSource
    finally
      iIEBitmapSource.Free;
    end;
  finally
    Screen.Cursor := crDefault;
  end;
end;

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