Hi,
I am wondering if it's possible to make the TWebBrowser's background transparent? which it will only display the html content and nothing else. That would be very interesting, don't you think ?Thanks!
Not if you use color black as your desktop background.
Even if your background color is red, all red text would be invisible. Sounds like nuisance to me.
After further review, I made an interesting discovery. IF you have an nVidia graphics card and have installed the nVidia Control Panel, you can right-click on any window and select "Make Window Transparent". To my surprise, transparent windows are not actually transparent, they are translucent.
So, if this was the effect zyzjacky was looking for, my first responce does not apply.
hi roo0047, that is an interesting one! but not exactly what i am looking for.
i have found a way to draw a bmp as the background, anyone of you can advice me to draw a png instead of bmp, or a transparent bmp? not using the transparent color, otherwise that area in the form would be invisible.
here is the code
procedure TformMain.FormShow(Sender: TObject);
begin
OldMessage:=WebBrowserMainFrame.WindowProc;
WebBrowserMainFrame.WindowProc:=OleMessage;
end;
procedure TformMain.OleMessage(var Msg: TMessage);
var
c:TCanvas;
bmpBG:TBitmap;
begin
OldMessage(Msg);
if Msg.Msg=WM_PAINT then
begin
bmpBG := TBitmap.Create;
//bmpBG.LoadFromFile(strCurrentDir+'\1.bmp');
c:=TControlCanvas.Create;
TControlCanvas(c).Control:=WebBrowser1;
c.Brush.Style:=bsClear;
c.StretchDraw(c.ClipRect,bmpBG);
end;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.