Einzelnen Beitrag anzeigen

Ryzinski

Registriert seit: 2. Okt 2012
38 Beiträge
 
#1

Image from TWebBrowser -> TPicture

  Alt 18. Nov 2012, 20:56
hi!

i found a c# solution but i have no idea how to do this in delphi.

Code:
  IHTMLDocument2 doc = (IHTMLDocument2)wb1.Document.DomDocument;
            IHTMLControlRange imgRange = (IHTMLControlRange)((HTMLBody)doc.body).createControlRange();

            foreach (IHTMLImgElement img in doc.images)
            {
                if (img.nameProp.Contains('sometag'))
                {
                    IHTMLElementRenderFixed render = (IHTMLElementRenderFixed)img;
                    Bitmap bmp = new Bitmap(img.width, img.height);
                    Graphics g = Graphics.FromImage(bmp);
                    IntPtr hdc = g.GetHdc();
                    render.DrawToDC(hdc);
                    g.ReleaseHdc(hdc);

                    ImageBmp = bmp;
                    break;
                }
            }
        }
  Mit Zitat antworten Zitat