• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 
24 November 2024, 07:57:52

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - bunak

1
Thank you very much
2
Help & Questions / change quolity for jpeg?
5 April 2011, 20:35:02
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.
3
And in result i do like this, and I happy
  singl_Img := TSingleImage.Create;
  singl_Img.CreateFromParams(img_W, img_H, ifGray8);
  CopyMemory(singl_Img.Bits, @imageBuf[0], singl_Img.Size);

  try
    singl_Img.SaveToFile(DirSave_path + '\' + img_name + '.' + cmbx_ImageExt.Text);
  finally
    singl_Img.Free;
  end;
4
Thank you

Help me please
I do like this
var
  singl_Img: TSingleImage;
  Img : TImageData;
begin
  if not NewImage(img_W, img_H, ifIndex8, Img) then Exit;
  CopyMemory(Img.Bits, @imageBuf[0], Img.Size);
  singl_Img.CreateFromData(Img);

  try
    singl_Img.SaveToFile(DirSave_path + '\' + node_img_name.NodeValue + '.jpg');
  finally
    singl_Img.Free;
  end;

but get "Access violation" error on singl_Img.CreateFromData(Img);

the error erise in this procedure
{ TBaseImage class implementation }
constructor TBaseImage.Create;
begin
  SetPointer;
end;
5
Do like this

  mem_st := TMemoryStream.Create;
  Img := TSingleImage.Create;
  try
    mem_st.WriteBuffer(imageBuf, 1280 * 1024);
    mem_st.Position := 0;
    Img.LoadFromStream(mem_st);
    Img.SaveToFile(DirSave_path + '\' + node_img_name.NodeValue + '.jpg');
  finally
    mem_st.Free;
    Img.Free;
  end;


In result - is nothing
6
I have images that fill by bytes.
This images- 1024х1280х1- opened in Photoshop as RAW - format, with parameter depth - 8 Bits, Count - 1, Width, Height

In code image save in
imageBuf: array[0..1279, 0..1023] of byte;

Is it possible convert this array of bytes to jpeg or png
SMF spam blocked by CleanTalk