Nanaki Posted March 26, 2005 Posted March 26, 2005 First, thanks to Xenogis for helping me a couple of days ago, I didn't want to bump an old topic. Next, I'm trying to load images onto the screen. This is my code (well, it's the example actually ): #include <GUIConstants.au3> GUICreate("My GUI picture",350,300,-1,-1,$WS_SIZEBOX+$WS_SYSMENU) ; will create a dialog box that when displayed is centered GUISetBkColor (0xE0FFFF) $n=GUICtrlCreatePic("pic.png",50,50, 200,50) GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend It loads .bmp, .gif and .jpg, but .png won't work. I've read in other posts that it's possible for AutoIt to load them, so I'm wondering why they don't. I've attached an example file for which doesn't work. I'm using the latest AutoIt+, but it also didn't work in the stable version (3.1). Tnx in advance
sylvanie Posted March 27, 2005 Posted March 27, 2005 hello, Yes, GUICtrlCreatePic seem's not working with png.But I have seen in a topic, a dll ( cwebpage.dll ), which allow to create windows with some html code.I have modified your code :#include <GUIConstants.au3>$gui=GUICreate("My GUI picture",350,300,-1,-1,$WS_SIZEBOX+$WS_SYSMENU) ; will create a dialog box that when displayed is centeredGUISetBkColor (0xE0FFFF)$pic=@WorkingDir&"\pic.png"$dll = DLLOpen("cwebpage.dll")DLLCall($dll,"long","EmbedBrowserObject","hwnd",$gui)$a='<BODY scroll=no bgcolor="#E0FFFF"><img src="'&$pic&'" style="position:absolute;left:100;top:100;width:100;height:100"></BODY>'DLLCall($dll,"long","DisplayHTMLStr","hwnd",$gui,"str",$a)GUISetState (); Run the GUI until the dialog is closedWhile 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoopWendexpandcollapse popupbut, be careful, the name of the picture must be between 2 Quotes " " I hope it'll help youcwebpage.dll sarkar112 Posted March 27, 2005 sarkar112 Active Members 27 Posted March 27, 2005 Since, it was posted in this topic lots of people are using cwebpage.dll for creating unique scripts. Nanaki Posted March 28, 2005 Nanaki Active Members 58 Author Posted March 28, 2005 Thanks, I'll try it out soon. Does this mean animated GIF and transparent images are also supported? Nanaki Posted March 28, 2005 Nanaki Active Members 58 Author Posted March 28, 2005 (edited) Thanks, it worked! Just a couple of questions tho Alright, I created this script: ; ---Options--- #include <GUIConstants.au3> #include <image_get_size.au3> #NoTrayIcon FileInstall("cwebpage.dll", @TempDir & "\cwebpage.dll") Global $textlabel="Label text", $file=@WorkingDir&"\pic.png", $size, $label, $dll, $gui HotKeySet("{ESC}", "Terminate") ; ---Determine image size--- $size=_ImageGetSize($file) Invoeren() ; ---The window itself--- Func Invoeren() $gui=GUICreate("This is the requested picture", $size[0], $size[1], -1, -1, $WS_POPUP+$WS_BORDER, $WS_EX_TOPMOST) GUISetBkColor(0xFFFFFF) $dll=DLLOpen(@TempDir & "\cwebpage.dll") DLLCall($dll,"long","EmbedBrowserObject","hwnd",$gui) $url='<BODY scroll=no bgcolor="#FFFFFF"><img src="'&$file&'" style="position:absolute;left:0;top:0;width:"&$size[0]&";height:"&$size[1]&"></BODY>' DLLCall($dll,"long","DisplayHTMLStr","hwnd",$gui,"str",$url) $label=GUICtrlCreateLabel($textlabel, 0, 0, $size[0], $size[1], $SS_CENTER+$SS_CENTERIMAGE) GUICtrlSetColor($label, 0xFFFFFF) GUICtrlSetFont($label, -1, -1, -1, "Verdana") GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Terminate() EndFunc ; ---Exit script--- Func Terminate() DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$gui) DLLClose($dll) FileDelete (@TempDir & "\cwebpage.dll") Exit EndFunc Now, it determines the height and length of "size.png" and shows it on the screen, with no white space around it. So far, so good. But when I try to put a label on top of it (in this case "label text") it also works, but only now and then. Half of the time it show, the other half it doesn't. Any idea on how to fix this? The same problem occurs with Animated GIF's, with the only difference the text is never shown, not once. Second, can real transparency be achieved? I tried creating the window with WS_EX_LAYERED but then it doesn't show the "webpage" anymore. :/ Tnx! Edited March 29, 2005 by Nanaki
Nanaki Posted March 30, 2005 Author Posted March 30, 2005 Well, I haven't found a solution yet, so anyone? I just care about the label, can you keep it "on top" on any way?
Apzo Posted March 31, 2005 Posted March 31, 2005 Hello Just wondering if someone tried libgd, using dll calls... I'll try it when I'll know how to list functions from a dll L.H. All the pop3 functions.Rsync your files on your USB key (or anywhere else)
Nanaki Posted March 31, 2005 Author Posted March 31, 2005 This is getting complicated. @ Larry: what do you mean with "information"? I have no problem displaying the pictures, nor determining the size. My problem is when I try to put a Label Control on top of it, it doesn't always appear. :/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now