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
 Can crop image without visible component?

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
ali Posted - Aug 14 2019 : 03:37:25
Hi Nigel

1. Can crop image without visible component of imageen (without imageenview/imageendbview)?
Can crop imageen with image standard Delphi?

2. Can change brightness/contrast without visible component of imageen (without imageenview/imageendbview)?
Can change brightness/contrast with image standard Delphi?


Best Regards

Ali Abbasi
11   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 21 2019 : 21:33:47
Hi Ali

// Crop the image at position, Top-Left: (20, 20), Bottom-right: (100, 100). The resulting image will be 80 x 80 pixels
ImageEnIO1.IEBitmap.Crop( 20, 20, 100, 100 );


Nigel
Xequte Software
www.imageen.com
ali Posted - Aug 21 2019 : 08:34:06
Hi Nigel

Please help me I can desire (ideal) crop image with none visual component for example with imageenIO.
I think you send me a simple demo then I can bettet understand.


Best Regards

Ali Abbasi
ali Posted - Aug 19 2019 : 16:48:45
Hi Nigel

Thanks for your help and my problems for adjust brightness and contrast is completely resolved.


Best Regards

Ali Abbasi
xequte Posted - Aug 17 2019 : 19:07:31
Hi Ali

You can already attach a TImage to a TImageEnIO:

https://www.imageen.com/help/TImageEnIO.AttachedTImage.html


Nigel
Xequte Software
www.imageen.com
ali Posted - Aug 17 2019 : 14:32:38
Hi Nigel

In the next version, you can assign TImage and TGraphic types directly to TIEBitmap and TImageEnView.

If we can copy directly from ImageEnIO to image1 or image1 to ImageEnIO1 then it is very nice!
Similar this is good and simple:
ImageEnIO1.assign (image1);
Image1.assign(ImageEnIO1);

Best Regards

Ali Abbasi
ali Posted - Aug 17 2019 : 14:09:02
Hi Nigel

Thank you your help, but I cannot use your pervios topic.

Below code working corectly, but I want to do not use savetofile and loadfromfile in two times to below code.
Because I cannot save from image1 to ImageEnIO1 and after change brightness & contrast & saturation then save from ImageEnIO1 to image1.

procedure TPictureForm.UniBitBtn2Click(Sender: TObject);
var
 iebmp : TIEBitmap ;
 jpg   : TJPEGImage;
begin
  jpg:=TJPEGImage.Create;

  iebmp := TIEBitmap.Create;
  ImageEnProc1.AttachedIEBitmap := iebmp;
  ImageEnIO1.AttachedIEBitmap   := iebmp;

  try
   Image1.assign(DBImage);
   Image1.Picture.SaveToFile(DM1.Global_Main_Path+'temp.jpg');
   ImageEnIO1.LoadFromFile(DM1.Global_Main_Path+'temp.jpg');

   ImageEnProc1.AdjustBrightnessContrastSaturation(
   UniTrackBar_Brightness.Position,UniTrackBar_Contrast.Position,UniTrackBar_Saturation.Position );

   ImageEnIO1.SaveToFile(DM1.Global_Main_Path+'temp.jpg');
   Image1.Picture.LoadFromFile(DM1.Global_Main_Path+'temp.jpg');

   finally
    jpg.Free;
    ImageEnIO1.Free;
    ImageEnProc1.Free;
    iebmp.Free;
  end;

end;

Best Regards

Ali Abbasi
xequte Posted - Aug 16 2019 : 19:27:29
Hi Ali

In the next version, you can assign TImage and TGraphic types directly to TIEBitmap and TImageEnView.

Currently you can use:

  ImageEnView1.Assign( Image1.Picture.Bitmap );
  iebmp.Assign( Image1.Picture.Bitmap );


  jpg := TJpegImage.Create;
  try
    jpg.Loadfromfile( 'D:\_Test.jpg' );
    bmp := TBitmap.Create;
    try
      bmp.assign( jpg );
      ImageEnView1.Assign( bmp );
    finally
      bmp.free
    end
  finally
    jpg.free
  end;


TImageEnIO can be attached to a TIEBitmap. Why do you want to use a TJpegImage and TImageEnIO together (as TImageEnIO already works with JPEG images).

Nigel
Xequte Software
www.imageen.com
ali Posted - Aug 16 2019 : 07:08:49
Dear Nigel

Thank you your reply and I will test it.

Please help me for assign jpg (TJPEGImage) to ImageEnIO.
I want to assign stream jpg to ImageEnIO.

Also I want to assign TImage which have a jpg image for send to ImageEnIO

Best Regards

Ali Abbasi
xequte Posted - Aug 16 2019 : 00:01:12
Hi Ali

To adjust a rect so it matches an aspect ratio (e.g. of a TImageEnView) you can use the GetImageRectWithinArea method:

https://www.imageen.com/help/GetImageRectWithinArea.html

Nigel
Xequte Software
www.imageen.com
ali Posted - Aug 15 2019 : 01:22:19
Hi Nigel

Thank you for your help!

I cannot desire (ideal) crop similar miselect with aspect ratio of imageen for example I cannot select any top-left and bottom-right in run time.
If you have solution for run time desire select by user then advise me.

I think I can change brithness and contrast.

Best Regards

Ali Abbasi
xequte Posted - Aug 14 2019 : 17:52:54
Hi

If you load an image into a TIEBitmap (ImageEn's advanced TBitmap class) then you can crop it using:

http://www.imageen.com/help/TIEBitmap.Crop.html

Example:

IEBmp := TIEBitmap.create;
IEBmp.Read( 'D:\SomePic.jpg' );
// Crop the image at position, Top-Left: (20, 20), Bottom-right: (100, 100).
IEBmp.Crop( 20, 20, 100, 100 );
IEBmp.Write( 'D:\SomePic_Cropped.jpg' );
IEBmp.Free;


For other image modifications, attach a TIEBitmap or TBitmap to a TImageEnProc:

http://www.imageen.com/help/TImageEnProc.CreateFromBitmap.html
http://www.imageen.com/help/TImageEnProc.AdjustBrightnessContrastSaturation.html


with TImageEnProc.CreateFromBitmap(myBitmap) do
begin
  // Enhance brightness and contrast, maintain existing color saturation
  AdjustBrightnessContrastSaturation(50, 10, 0);
  Free;
end;


Nigel
Xequte Software
www.imageen.com