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;
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;
{ TBaseImage class implementation }
constructor TBaseImage.Create;
begin
SetPointer;
end;
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;
Page created in 0.035 seconds with 20 queries.