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
 How to assign a layer image to Image control?

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
yogiyang Posted - Aug 17 2018 : 08:52:44
Hello,

I want to assign current layer's content to Delphi's ImageControl?

But I am not able to do this.


      //Load the bitmap here
      MyBitmap := TIEBitmap.Create;
      MyBitmap.Assign(ImageEnViewMain.Layers[LayerNum].Bitmap);

      if MyBitmap.Width > MyBitmap.Height then
        MyBitmap.Resample(80, -1,rfNone,True)
      else
        MyBitmap.Resample(-1, 80,rfNone,True);

      //Assign the bitmat to StringGrid Cell
      MyCanvas := TImage(CurrentControl).Canvas;  //TCanvas.Create;

      MyBitmap.RenderToCanvas(MyCanvas, Rect.Left, Rect.Top,
          Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, rfFastLinear, 0);

      MyBitmap.Free;


What mistake am I making in this code?

TIA


Yogi Yang
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 30 2018 : 15:14:26
Hi Yogi

TImage also has a Picture property, so you can also use:

MyIEBitmap.CopyToTBitmap( Image1.Picture.Bitmap );


e.g.

// Load a RAW image into a TImage
myBmp := TIEBitmap.create;
myBmp.Read( 'C:\camera.dng' );
myBmp.CopyToTBitmap( Image1.Picture.Bitmap );
myBmp.Free;



Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Aug 30 2018 : 07:36:41
Hello,

Thanks for suggestion.

Actually Image Control has only TCanvas available.

But assigning anything to this does not show in Image Control.

TIA


Yogi Yang
xequte Posted - Aug 23 2018 : 20:08:41
I don't know TImage well, but why not just assign the TIEBitmap to the TBitmap of the TImage control?

Nigel
Xequte Software
www.imageen.com