Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Overbyte ICS und AnswerStream (https://www.delphipraxis.net/158108-overbyte-ics-und-answerstream.html)

schwa226 5. Feb 2011 21:55

Overbyte ICS und AnswerStream
 
Hi,

ich bin gerade dabie mich in den Web Server von Overbyte einzuarbeiten.

Über diese Funktion kann ich schon einmal ein Jpeg im Browser anzeigen:
Delphi-Quellcode:
procedure TUrlHandlerTest.Execute;
var
  JpegImg  : TJPEGImage;
  BitMapImg : TBitmap;
begin

  DocStream := TMemoryStream.Create;
  JpegImg := TJPEGImage.Create;
  try
     BitMapImg := TBitMap.Create;
     try
         BitMapImg.Width := 64;
         BitMapImg.Height := 32;
         BitMapImg.Canvas.Pen.Color  := clBlack;
         BitMapImg.Canvas.Brush.Color := clGray;
         BitMapImg.Canvas.RoundRect(0, 0,
             BitMapImg.Width - 1, BitMapImg.Height - 1, 16, 16);
         BitMapImg.Canvas.Font.Name := 'arial';
         BitMapImg.Canvas.Font.Size := 14;
         BitMapImg.Canvas.Font.Color := clWhite;
         BitMapImg.Canvas.TextOut(
  (BitMapImg.Width - BitMapImg.Canvas.TextWidth('test1')) div 2 - 1,
  (BitMapImg.Height - BitMapImg.Canvas.TextHeight('test1')) div 2 - 1,
            'test1');
         JpegImg.Assign(BitMapImg);
         JpegImg.SaveToStream(DocStream);
     finally
         BitMapImg.Destroy;
     end;
  finally
     JpegImg.Destroy;
  end;
  AnswerStream('', 'image/jpeg', NO_CACHE);

  Finish;
end;
Aber nun ist halt nur das Bild selber sichtbar.

Ich habe aber eine HTML Seite worin ich ein Bild anzeigen will. Geht das auch?
Oder muss ich das Jpeg zuerst auf der Festplatte speichern und dann ein Image Link im HTML einbauen?


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:27 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz