tpictureView and GIF?

Is there anyway to print a GIF with TPictureView or an fairly accurate way to convert from gif to JPG?

-Markus

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:58AM
    Hi
    IIRC no
    you would need to convert gif to jpg or bmp or wmf using an external lib
    then assign the result to the frpictureview's picture.
    regards ;)
  • edited 2:58AM
    Hi!

    If You need the picture to be loaded in designtime do the following:

    Open the following files from \FR_directory\source\ :
    - FR_GEdit.pas
    - FR.INC

    The followings suppose You have the GraphicEx library freely available from www.lischke-online.de (currently out of service). You must include its path in the library path in the IDE. GraphicEx doesn't need installation.

    After this edit the FR.INC file like this:

    add the following line anywhere You want:
    {$DEFINE GRAPHICEX}

    uncomment the
    {$DEFINE OPENPICTUREDLG} line

    After this edit the FR_GEdit file like this:

    Uses clause:
    SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
    Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, FR_Class, FR_Const{$IFDEF GRAPHICEX}, GraphicEx{$ENDIF};

    procedure TfrGEditorForm.BitBtn1Click(Sender: TObject);

    .....

    {$IFNDEF GRAPHICEX}//add this line
    {$IFDEF JPEG}
    OpenDlg.Filter := frLoadStr(SPictFile) +
    ' (*.bmp *.jpg *.ico *.wmf *.emf)|*.bmp;*.jpg;*.ico;*.wmf;*.emf|' +
    frLoadStr(SAllFiles) + '|*.*';
    {$ELSE}
    OpenDlg.Filter := frLoadStr(SPictFile) +
    ' (*.bmp *.ico *.wmf *.emf)|*.bmp;*.ico;*.wmf;*.emf|' +
    frLoadStr(SAllFiles) + '|*.*';
    {$ENDIF}
    {$ENDIF}//add this line

    After all recompile the FR package. With this method You will get about 30+ extensions available in the Picture editor at designtime with preview capabilities. These contains all of the popular image formats.

    Regards:Alex
  • edited 2:58AM
    Sorry for the previous post, it works only in the designer yet, I didn't preview using the above method and when previewing the image is not displayed, only in designtime. Must look into the source.

    Regards:Alex
  • edited 2:58AM
    The problem solved. Only one change to the FR source has left. Open the FR_Class.pas file and locate the TfrPictureView.ShowEditor procedure. Modify it like the following:

    procedure TfrPictureView.ShowEditor;
    Var Bm:TBitmap;
    begin
    frPictureEditor(nil);
    Bm:=TBitmap.Create;
    Bm.Assign(Picture.Graphic);
    Picture.Bitmap.Assign(Bm);
    Bm.Free;
    end;

    This way all loaded image will be stored as bitmap and FR can save it to stream and can render them on the final EMF page.
  • edited 2:58AM
    One more note. You can include any unit in the uses clause of FR_GEdit.pas that contains class definitions implementing TGraphic based classes. This way You can extend FR to load ANY image format supported by the included classes.

    Regards:Alex
  • LogoutLogout Portugal
    edited 2:58AM
    Thanks,

    I need this to.
    ;)

    Regards,
  • edited 2:58AM
    In my opinion, this solution is worth being added to the FAQ-list....
    Regards,
    Stephen
  • edited 2:58AM
    Hi Stephen!

    I've already finished my work and my TFRPictureView based component is ready for use. It can do all of the above with advanced editor (effects, etc) and correct rendering when setting stretched to false (ie. correct clipping at boundaries if the picture is bigger then the clipping rectangle). I will put it on the Yahoo groups files section in few days.

    Regards:Alex
  • edited 2:58AM
    Thanks all for your help!!!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.