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