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
 TImageEnMView.MIO.Params[i].JPEG_Quality
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aleatprog

21 Posts

Posted - Apr 04 2019 :  12:28:06  Show Profile  Reply
Sorry, do you have additional information about how to change the JPEG quality in TImageEnMView?

In the following example, if JPEG quality got the value 10 or 100, the image quality and size won't change. There should be missing something, but I didn't found a hint in the manual or in the examples.


  for i := 0 to TImageEnMView.MultiSelectedImagesCount - 1 do
  begin
    TImageEnMView.MIO.Params[i].JPEG_Quality := 80;
    TImageEnMView.GetTIEBitmap(i).Write('c:\temp\test_' + IntToStr(i + 1) + '.jpg');
    TImageEnMView.ReleaseBitmap(i);
  end;

xequte

4538 Posts

Posted - Apr 04 2019 :  19:18:30  Show Profile  Reply
Hi

Unfortunately, in that situation, the TIEBitmap you are saving does not have access to the params, either use GetImageToFile:

https://www.imageen.com/help/ImageEn/TImageEnMView.GetImageToFile.html

Or assign the MView bitmap to bmp object, and then enable the params, e.g.

bmp := TImageEnMView.GetTIEBitmap(i);
bmp.ParamsEnabled := True;
bmp.JPEG_Quality := 80;
bmp.Write('c:\temp\test_' + IntToStr(i + 1) + '.jpg');
TImageEnMView.ReleaseBitmap(i);

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

aleatprog

21 Posts

Posted - Apr 05 2019 :  16:31:19  Show Profile  Reply
Thank you Nigel, I tried both ways and both work fine.

I tried to use the bmp object approach also with multipage TIFF. The following code created an access violation:

bmp := TImageEnMView.GetTIEBitmap(i);
bmp.Resample(Round(bmp.Width*0,5), Round(bmp.Height*0,5), rfLanczos3, True, True);
bmp.ParamsEnabled := True;
bmp.Params.TIFF_Compression := ioTIFF_G4FAX;
TImageEnMView.SetImage(i, bmp);
TImageEnMView.ReleaseBitmap(i);
TImageEnMView.MIO.SaveToFileTIFF(c:\temp\test.tif, True);


Which approach would you suggest in order to resize and convert to BW more than one bitmap and then save them all as multipage TIFF with G4 compression?
Go to Top of Page

xequte

4538 Posts

Posted - Apr 07 2019 :  05:47:20  Show Profile  Reply
Hi

You should not call SetImage in your code, instead enable the second parameter of ReleaseBitmap:

ImageEnMView1.ReleaseBitmap( i, TRUE );

https://www.imageen.com/help/ImageEn/TImageEnMView.ReleaseBitmap.html


Also, set the params via:

ImageEnMView1.Params[i].TIFF_Compression := ioTIFF_G4FAX;

Also, see:

https://www.imageen.com/help/ImageEn/TImageEnMIO.DuplicateCompressionInfo.html

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