ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How can I get the image of ImageEnView screen display part?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

foxdingding

77 Posts

Posted - Jul 06 2022 :  01:58:14  Show Profile  Reply
How can I get the image of ImageEnView screen display part?

Like this Code:


Var
         bmpscreen:Tbitmap;
         FullscreenCanvas:TCanvas;
         dc:HDC;
         sourceRect, destRect: TRect;
         a,b,c,d:Integer;

Begin

         a:=0;
         b:=0;
         c:=ImageEnView1.Width;
         d:=ImageEnView1.Height;

         dc:=getdc(Self.ImageEnView1.Handle);
         fullscreencanvas:=Tcanvas.Create;
         bmpscreen:=Tbitmap.create;
Try	


            fullscreencanvas.Handle:=dc;

            bmpscreen.Width :=c-a;
            bmpscreen.Height :=d-b;
            sourcerect:=rect(0,0,c-a ,d-b );
            destrect:= rect(a,b,c,d);

            bmpscreen.Canvas.CopyRect(sourcerect,fullscreenCanvas,destrect);
            ImageEnView2.IEBitmap.CopyFromTBitmap(bmpscreen);
            ImageEnView2.Update;
       Finally
            bmpscreen.Free;
            FullscreenCanvas.Free;
            ReleaseDC(Self.ImageEnView1.Handle, DC);
         End;



foxdingding

77 Posts

Posted - Jul 06 2022 :  02:01:03  Show Profile  Reply
I don't know whether I can or can' t?


            ImageEnView2.IEBitmap.Width := ImageEnView1.ExtentX;
            ImageEnView2.IEBitmap.Height := ImageEnView1.ExtentY;

            ImageEnView1.DrawTo(ImageEnView2.IEBitmap.Canvas);
            ImageEnView2.Update;
Go to Top of Page

xequte

38608 Posts

Posted - Jul 07 2022 :  00:38:26  Show Profile  Reply
Hi

If you are looking for the displayed area of the image please see:

https://www.imageen.com/help/TImageEnView.VisibleBitmapRect.html

There are examples there for drawing it to another ImageEnView.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

foxdingding

77 Posts

Posted - Jul 07 2022 :  02:05:26  Show Profile  Reply
I think it should be this


Example
// draw in ImageEn2 all what is displayed in ImageEnView1
ImageEnView1.DrawTo(ImageEnView2.IEBitmap.Canvas);
ImageEnView2.Update;


Description
Returns the height of the area used to show the current image (i.e. the height of the image as it appears onscreen).
If scrollbars are visible, only the visible height will be returned.



Example

// Copy the actual view of ImageEnView1 as the current image of ImageEnView2
ImageEnView2.IEBitmap.Width := ImageEnView1.ExtentX;
ImageEnView2.IEBitmap.Height := ImageEnView1.ExtentY;
ImageEnView1.DrawTo(ImageEnView2.IEBitmap.Canvas);

Go to Top of Page

xequte

38608 Posts

Posted - Jul 07 2022 :  23:53:24  Show Profile  Reply
Yes, you are right. We have added a TIEBitmap overload to the current beta so you can call like:

ImageEnView1.DrawTo( ImageEnView2.IEBitmap );
ImageEnView2.Update();


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: