• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

change quolity for jpeg?

Started by bunak, 5 April 2011, 20:35:02

Previous topic - Next topic

bunak

5 April 2011, 20:35:02 Last Edit: 28 July 2011, 22:14:54 by Galfar
HI

I load jpeg200 from TBlob to TSingleImage and convert jpeg2000 to jpeg format.
Code (pascal) Select
str_file_path := "c:\file.";

TBlobField(qr_graphic.FieldByName('GRAPHIC')).SaveToStream(mem_st);
Img := TSingleImage.Create;
try
  try
     mem_st := TMemoryStream.Create;
     mem_st.Position := 0;
     Img.LoadFromStream(mem_st);
     Img.SaveToFile(str_file_path + 'jpg');
  except
  end;
finally
  mem_st.Free;
  Img.Free;
end;


But how I can change quality of jpeg to 75% or recomperss it? Help please.

Galfar

Just call SetOption(ImagingJpegQuality, 75)
between Img.LoadFromStream(mem_st) and Img.SaveToFile(str_file_path + 'jpg')

bunak


Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk