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
 Stretch image not working

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
jwest Posted - Mar 22 2018 : 11:04:07
Hi, I have a camera and I need to grab a frame to ImageEnView Control.

I have set autofit, autostretch and autoshrink to false in my target ImageEnView(to receive the copied frame).

But, After I copied the image from camera to ImageEnView Control the image
shows with scrollbar and much bigger than container dimensions.

If I grab the frame a second time, the image shows correctly without scrollbars and the stretch is ok.

How could I fix it?

var ImageEnViewFoto, ImageEnViewCamera:TImageEnView;
....
procedure TfrmFrameCliente.ImageEnViewCameraDShowNewFrame(Sender: TObject);
begin
// copy current sample to ImageEnView bitmap
ImageEnViewCamera.IO.DShowParams.GetSample(ImageEnViewCamera.IEBitmap);
ImageEnViewCamera.Stretch;
// refresh ImageEnView1
ImageEnViewCamera.Update;
end;

procedure TfrmFrameCliente.grabframe();
begin
ImageEnViewFoto.AutoFit:=false;
ImageEnViewFoto.AutoStretch:=false;
ImageEnViewFoto.AutoShrink:=false;
ImageEnViewFoto.IEBitmap.Assign(ImageEnViewCamera.IEBitmap);
ImageEnViewFoto.Stretch;
ImageEnViewFoto.Update;
end;

3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 22 2018 : 20:20:13
Hi

Do you mean that you want to stretch the image without painting the aspect ratio? (i.e. no border area even if the content is stretched unevenly).

You can do that as follows:

// Stretch without maintaining the aspect ratio
ImageEnView.GetIdealZoom( ZoomX, ZoomY );
ImageEnView.ZoomX := ZoomX;
ImageEnView.ZoomY := ZoomY;


Nigel
Xequte Software
www.imageen.com
jwest Posted - Mar 22 2018 : 19:18:55
if I grab the frame two times all works well. Why?
How to do ImageEnView stretch works like TImage stretch?
xequte Posted - Mar 22 2018 : 14:21:07
Hi

Stretch has no effect if the image is larger than the ImageEnView. I think Shrink is the method you want to use.



Nigel
Xequte Software
www.imageen.com