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

Post reply

Other options

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

Topic summary

Posted by shamballa
 - 11 June 2009, 18:20:55
Hi,

Thank you very much, it works very well and is shorter code!

shamballa
Posted by Galfar
 - 10 June 2009, 23:55:48
Sorry for late answer, so if I understand this correctly:

You have TImage on form with TBitmap assigned to Picture property and you want to save this TBitmap to image file format selected by user.

You can convert TBitmap to Imaging's image easier than in your code this way:

uses ...., ImagingComponents;
begin
  FImage := TSingleImage.Create;
  ConvertBitmapToImage(ASCIIImg.Picture.Bitmap, FImage);
  ....
  FImage.SaveToFile(CopyPath);
  ...
end;


Posted by shamballa
 -  5 June 2009, 14:09:18
ok I think I have found a way but not sure if it is the best way!

var
  ImgStream: TMemoryStream;
begin
  try
    ImgStream := TMemoryStream.Create;
    FImage := TMultiImage.Create;
    ASCIIImg.Picture.Graphic.SaveToStream(ImgStream);
    ImgStream.Position := 0;
    FImage.LoadMultiFromStream(ImgStream);
  finally
    ImgStream.Free;
  end;


...Then I am saving this way like in the Demo

var
  CopyPath: string;
begin
  SaveDlg.Filter := Imaging.GetImageFileFormatsFilter(False);
  SaveDlg.FileName := ChangeFileExt(ExtractFileName(FFileName), '');
  SaveDlg.FilterIndex := Imaging.GetFileNameFilterIndex(FFileName, False);
  if SaveDlg.Execute then
  begin
    CopyPath := ChangeFileExt(SaveDlg.FileName, '.' +
      Imaging.GetFilterIndexExtension(SaveDlg.FilterIndex, False));
    FImage.SaveToFile(CopyPath);
  end;


* This code "is" saving the images, but is there a better way?

Many thanks

Shamballa
Posted by shamballa
 -  5 June 2009, 04:50:13
Hi,

This may be a stupid question but is it possible to use a normal TImage with this library?

Basically what I am doing is converting Extended ASCII characters to a Bitmap which I then want to save in other formats but I am a little confused as to how I can do this with a normal TImage Component using this library or if this is even possible?

Please could you inform me if it is?

Many thanks

Shamballa
SMF spam blocked by CleanTalk