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
 StretchRectTo goes crazy

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
Xylit Posted - Jul 04 2012 : 03:53:13
Hi,

I want to shrink the left-most 40 columns and the right-most 40 columns of an image to each 30 columns. The middle of the image should stay the same.
This method is working fine for the left side and the middle. But the right side does not shrink. What am I missing?
procedure TRoboScreenManager.BendPanelPicture(const sourcePic: TIEBitmap);
var
  destPic : TIEBItmap;
const
  d = 30;   // destination 
  s = 40;   // source
begin
  destPic := TIEBItmap.Create(sourcePic.Width - (s-d)*2, sourcePic.Height);

  sourcepic.CopyRectTo(destPic, s,0, d,0 ,DestPic.Width - d*2 ,sourcePic.Height);
  sourcePic.StretchRectTo(destPic, 0,0,d,destPic.Height-1, 0,0,s,sourcePic.Height-1, rfNone, 255);
  sourcePic.StretchRectTo(destPic, destPic.Width-d,0,destPic.Width-1,destPic.Height-1, sourcePic.Width-s,0,sourcePic.Width-1,sourcePic.Height-1, rfNone, 255);

  sourcePic.Assign(destPic);
  destPic.Free;
end;


I am using the actual version of ImageEn
2   L A T E S T    R E P L I E S    (Newest First)
Xylit Posted - Jul 04 2012 : 08:25:04
Okay thanks, makes sense if you know that dxDst and dyDst is not a second set of coordinates but a size.
Please add this information to the methods documentation.
fab Posted - Jul 04 2012 : 08:02:06
Hi,
change the second StrectRectTo to:
sourcePic.StretchRectTo(destPic, destPic.Width-d-1,0,d,destPic.Height-1, sourcePic.Width-s-1,0,s,sourcePic.Height-1, rfNone, 255);