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}
{$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.
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.
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.
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.
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.
Comments
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
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
Regards:Alex
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.
Regards:Alex
I need this to.
Regards,
Regards,
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