AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Load Image From TBitmap (or Stream)

Ein Thema von mr_fahrrad · begonnen am 29. Dez 2006 · letzter Beitrag vom 29. Dez 2006
Antwort Antwort
mr_fahrrad

Registriert seit: 28. Dez 2006
46 Beiträge
 
#1

Load Image From TBitmap (or Stream)

  Alt 29. Dez 2006, 18:41
how I make to load image from Stream (or Bitmap) ?

with the code:

Delphi-Quellcode:
var
  li: Word;
begin
  // Loop through all images of a TWebbrowser
  // Schleife über alle Bilder im Webbrowser
  for li := 0 to WebBrowser1.OleObject.Document.Images.Length - 1 do
    WebBrowser1.OleObject.Document.Images.Item(li).Src :='c:\file.bmp';
end;
I change all images in TWebBrowser, but from a file in my hard Disk (or URL)

How i make to change the src from image loading the picture fom a Bitmap or a Stream?

Thanks for the help and sorry for the post in english... You can answer me in Deutsch if you want
  Mit Zitat antworten Zitat
Benutzerbild von little_budda
little_budda

Registriert seit: 5. Mai 2006
Ort: Velbert
246 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Load Image From TBitmap (or Stream)

  Alt 29. Dez 2006, 19:28
Hallo,

ich lade Bilder vom Server mit folgendem Code

Delphi-Quellcode:
  // Stream erzeugen und auf URL verweisen
  ImageStream:=TFileStream.Create('URL', fmCreate or fmShareDenyWrite);
  try
    // File laden und lokal ablegen
    IdHTTP1.Get('LOKALER DATEINAME', ImageStream);
  finally
    // Steam freigeben
    ImageStream.Free;
  end;
Gruß Holger.
Holger
Glück findet sich nicht im Code
Gefahren werden ist nur solange schön wie man selbst nicht lenken möchte ...
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#3

Re: Load Image From TBitmap (or Stream)

  Alt 29. Dez 2006, 19:31
I'm afraid the Webbrowser won't take a picture from a stream (there are obscure methods, like placing the image content in the dcument BASE64-encoded... i don't know about them).

You could save the image to a temporary file and tell the WebBrowser to load it from there.

@Holger: Das ist nicht das was er sucht
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.606 Beiträge
 
#4

Re: Load Image From TBitmap (or Stream)

  Alt 29. Dez 2006, 19:32
Sorry, but I don't think this is possible at all.

The TWebBrowser component encapsules the normal Internet Explorer, which is in fact loaded as a seperate process and displayed in your application.

You do have access to the DOM in the internet explorer process which can pointing to URI's of pictures, but you don't have access to the rendering engine, and this is, where the pictures are loaded and displayed in fact.

So I fear you can't change the location where the picture is loaded from from an URL to a pointer inside the application memory (where a stream or a TBitmap would be located at).

I think as a workaround you could write the picture from application memory to a file in the windows temporary directory and point the url to that temporary file.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
29. Dez 2006, 19:34
Dieses Thema wurde von "Phoenix" von "Internet / LAN / ASP.NET" nach "VCL / WinForms / Controls" verschoben.
Es geht eher um das TWebbrowser Control und lokale Files als um Kommunikation via Internet
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:22 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz