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
 Thumb Edge works only one time

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
wesleybobato Posted - Feb 01 2014 : 11:17:06
Hello Friends.
I found some strange behavior TImageEnMView
I added an Add Borders Code in Single Thumbnail, after I cleaned the code does not list precesses over what will be?

after I press the checkbox clear the code button does not work anymore?

is possible to add edges in thumbnail otherwise?

thanks for listening

https://www.dropbox.com/s/uku39saaz9fipuj/ImageBorder.zip
10   L A T E S T    R E P L I E S    (Newest First)
wesleybobato Posted - Aug 06 2014 : 09:52:57
Hi William

Thank you very much for your clarification I'll test here in the office

Have a Wonderful Day
w2m Posted - Aug 05 2014 : 14:16:53
Some testing here reveals that when you set ImageEnMView1.ThumbnailClipping := 100; all the thumbnails do not have identical size as stated in the documentation. If all thumbnails should have identical size then there is something wrong with thumbnail clipping. In the screenshot Thumbnails A and B are 1280 X 1024, C and D are 1920 x 1200 and E and F are 2048 x 1536 and G and H are 4896 x 3672.

So... the A and B thumbnails are considerably smaller than the other thumbnails.


Thumbnail text is set by:
procedure TForm1.ImageEnMView1AllDisplayed(Sender: TObject);
var
  i: Integer;
  iIEBitmap: TIEBitmap;
begin
  for i := 0 to ImageEnMView1.ImageCount - 1 do
  begin
    ImageEnMView1.ImageInfoText[i].Caption :=
      IntegerToString(ImageEnMView1.ImageWidth[i]) + ' x ' +
      IntegerToString(ImageEnMView1.ImageHeight[i]);
    ImageEnMView1.ImageBottomText[i].Caption :=
      ExtractFilename(ImageEnMView1.ImageFileName[i]);
  end;
end;

Further investigation reveals that the thumbnails are the same size if ImageEnMView1.ImageTopText[i].Caption or ImageEnMView1.ImageInfoText[i].Caption are NOT set as shown below.

I have no idea why setting the ImageInfoText[i].Caption or ImageTopText[i].Caption should have any effect on the dimensions of the thumbnail, but apparently it does. So the conclusion is, to get thumbnails of equal dimensions do not set ImageInfoText or ImageTopText.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
wesleybobato Posted - Aug 05 2014 : 13:08:59
Hi William.

Thanks I managed to invent code to my need umm here it from your code.

Excellent explanation, you're the best.

My Question is possible to add an option as well.

TImageEnMView.ImageThumbnailClipping [idx]: = 60;

you can check the possibility of adding this feature individually for each thumbnail

Thanks again.
w2m Posted - Aug 05 2014 : 12:59:10
Wesley,

You can fill the entire thumbnail area by setting ImageEnMView1.ThumbnailClipping := 100;

You may have to adjust the value depending on the dimensions of the images you are loading.

Automatically clips the sides of the thumbnail when displaying it so that it more closely matches the size of the grid cell, for example, if you have a tall/portrait image the top and bottom would not be shown so that the thumbnail is as wide as the display area.

ThumbnailClipping is a percentage so the valid range is 0 to 100.

Possible values
Value Description
0 The entire image will be displayed as a thumbnail pointer.
1 - 99 The percentage of permissible clipping. E.g. 10 would mean that up 10% of the image can be clipped.
100 The maximum clipping will be performed so that the thumbnail has no border space (and all thumbnails will be displayed at an identical size)

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
wesleybobato Posted - Aug 03 2014 : 14:45:26
William Help me please.

When I Move the Trackbar
I click the checkbox and the image does not fill entire

thanks for listening

https://www.dropbox.com/s/prejlcigl8ts3ok/william_thumb_border.zip
wesleybobato Posted - Feb 03 2014 : 04:31:32
William Thank you my friend is the maximum
w2m Posted - Feb 02 2014 : 07:46:14
Here is some code to render a thumbnail with a white top and bottom border if the checkbox is checked and a full thumbnail if the checkbox is not checked:

procedure TForm2.ImageEnMView1CheckboxClick(Sender: TObject; idx: Integer;
  var bChecked: Boolean);
{ Toggle showing a thumbnail with a white top border and a white bottom border
  with the full sized bitmap. Each thumbnail will always have a white border at the top
  and bottom regardless of the dimensions of the original image. }
var
  iImageEnIO: TImageEnIO;
  iThumbnail: TBitmap;
  iBitmap: TBitmap;
begin
 case ImageEnMView1.StoreType of
   ietThumb, ietFastThumb, ietNormal:
    begin
     { Get the index of the selected thumbnail }
     ImageEnMView1.SelectedImage := idx;
      case bChecked of
       True:
        begin
         { Each thumbnail will always have a white border at the top
          and bottom regardless of the dimensions of the original image. }
         ImageEnMView1.BackGround := clWhite;
         ImageEnMView1.IEBitmap.IEInitialize(150, 100, clWhite);
         { Create an imageenio to load the bitmap }
         iImageEnIO := TImageEnIO.Create(nil);
         { Create a bitmap to hold the thumbnail }
         iThumbnail := TBitmap.Create;
         { Create a base bitmap which is larger than the thumbnail }
         iBitmap := TBitmap.Create;
         iBitmap.PixelFormat := pf24bit;
         iBitmap.IEInitialize(150, 100, clWhite);
         { Attach the thumbnail to imageenio }
         iImageEnIO.AttachedBitmap := iThumbnail;
         { Load the thumbnail into iThumbnail }
         iImageEnIO.LoadFromFileFast(ImageEnMView1.ImageFileName[idx], 130, 80, false);
         { Resample the thumbnail to be 20 pixels shorter than the iBirmap }
         iThumbnail.IEResample(iBitmap.Width, iBitmap.Height-20, rfNone, False);
         { Draw the iThumbnail on the iBitmap 10 pixels from the top }
         iBitmap.Canvas.Draw(0, 10, iThumbnail);
         { Assign the bitmap with the white top and bottom border to ImageEnMView Bitmap }
         ImageEnMView1.Bitmap.Assign(iBitmap);
         { Update the image }
         ImageEnMView1.UpdateImage(idx);
         { Free the objects }
         iImageEnIO.Free;
         iThumbnail.Free;
         iBitmap.Free;
        end;
       False:
        begin
         { Each thumbnail will be full size }
         ImageEnMView1.ReloadImage(Idx);
        end;
     end;
    end;
  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
w2m Posted - Feb 01 2014 : 15:25:44
Why do you want white border only on top and bottom?

Unfortunately, please take some time to describe what you whan to achieve as I am not sure of what you are looking for....

meanwhile look at this:
uses iexhelperfunctions, hyiedefs;
ImageEnMView1.IEBitmap.IELoadAsThumbnail(ImageEnMView1.ImageFileName[idx], OrigWidth, OrigHeight, true, false, rfLanczos3, true, clWhite, true, 4, 4, clblack, clwhite);

With this function you can automatically resample the thumbnail to the dimensions you want, optionally add a white border around the thumbnail and add a shadow to the thumbnail.

CanStretch - Set to false to avoid images smaller than iMaxX x iMaxY from being made larger.
bAutoAdjustOrientation - Sets TIOParamsVals.EnableAdjustOrientation to automatically re-orient JPEG camera images
QualityFilter- Specify the quality that is used for rescaling the image
bAddBorder- Set to true to add a 1 pixel border to the thumbnail
cBorderColor- The color of the added border
bAddShadow- Add a solid or soft shadow to the image
iBlurRadius- Set to 0 to add a solid shadow or any other value for the width of the TImageEnProc.AddSoftShadow Soft Shadow
iShadowOffset- TImageEnProc.AddSoftShadow offset of the shadow from the image
cShadowColor- The shadow color
cBGColor- The color of the image behind the shadow

Example

MyIEBitmap.IELoadAsThumbnail(iFilename, iMaxX, iMaxY, iCanStretch,
          iAutoAdjustOrientation, iQualityFilter, iAddBorder, iBorderColor, iAddShadow,
          iBlurRadius, iShadowOffset, iShadowColor, iBackgroundColor);


So you can do something like this:

procedure TForm2.ImageEnMView1CheckboxClick(Sender: TObject; idx: Integer;
  var bChecked: Boolean);
var
 OrigWidth, origHeight: Integer;
 oLeft, oTop, oRight, oBottom: Integer;
begin
 case ImageEnMView1.StoreType of
   ietThumb, ietFastThumb, ietNormal:
    begin
     ImageEnMView1.SelectedImage := idx;
      case bChecked of
       True:
        begin
         OrigWidth := ImageEnMView1.IEBitmap.Width;
         OrigHeight := ImageEnMView1.IEBitmap.Height;
         ImageEnMView1.BackGround := clWhite;
         ImageEnMView1.IEBitmap.IELoadAsThumbnail(ImageEnMView1.ImageFileName[idx], 150, 100, true, false, rfLanczos3, true, clWhite, true, 4, 4, clblack, clwhite);
         ImageEnMView1.UpdateImage(idx);
        end;
       False:
        begin
         ImageEnMView1.ReloadImage(Idx);
        end;
     end;
    end;
  end;
end;

Is this something you like?

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
wesleybobato Posted - Feb 01 2014 : 15:04:10
Hello William I Just Want to Add Borders
On top and below
can you help me?

Good Sunday William
w2m Posted - Feb 01 2014 : 14:15:46
What do you mean? Do you want to add a white border around the thumbnail?

William Miller