[Lazarus] How to show a picture in a CGI app?

silvioprog silvioprog at gmail.com
Sat Apr 2 18:10:34 CEST 2011


2011/4/2 Michael Van Canneyt <michael at freepascal.org>:
> You can check the testsuite sources in the SVN repository of FPC:
> tests/utils/testsuite/utests.pp
>
> Michael.

Yes. Please, see my incomplete code:

[code]
var
  VFPMemoryImage: TFPMemoryImage;
begin
  Handled := True;
  VFPMemoryImage := TFPMemoryImage.Create(48, 48);
  try
    VFPMemoryImage.LoadFromFile('C:\lazarus\images\ide_icon48x48.png', ???);
    VFPMemoryImage.SaveToStream(AResponse.ContentStream, ???);
    AResponse.ContentType := 'image/png';
    AResponse.ContentLength := AResponse.ContentStream.Size;
    AResponse.SendContent;
  finally
    VFPMemoryImage.Free;
  end;
end;
[/code]

??? = My big doubt.

-- 
Silvio Cl├ęcio
=============================================
Blog - silvioprog.com.br
Twitter - twitter.com/silvioprog
LazSolutions - code.google.com/p/lazsolutions
Lazarus-BR - groups.google.com.br/group/lazarus-br?hl=pt-BR
=============================================




More information about the Lazarus mailing list