Jump to content

ReFran

Active Members
  • Posts

    548
  • Joined

  • Last visited

  • Days Won

    1

ReFran last won the day on September 25 2017

ReFran had the most liked content!

Profile Information

  • Location
    Germany
  • Interests
    a little bit AutoIt, vba, js, html, tcl, ...

Recent Profile Visitors

619 profile views

ReFran's Achievements

Universalist

Universalist (7/7)

16

Reputation

  1. In addition to Jos answer: To simple show/print PDFs embedded in your GUI, you need no Reader, no MuPdf, ... or other special com objects. You can simply use webview to show the pdf in any embedded browser environmental. br, Reinhard
  2. @BrewManNH Wonderful link. Saved it for later use under stackoverflow (google-maps-api or acrobat-sdk). Do you have some tips about the use? Reinhard
  3. "You cannot save a graphic context directly - only bitmaps / images." Hi, thought could be done more direct. Thanks for the working example. Maybe I work with "_GDIPlus_BitmapCreateFromFile" to load a background image and then draw on it. Also I don't need the transparent GUI really . So maybe I change that in order to get a white background. Have to play around with your example. Thanks for your help and have a nice (rest-) evening. Gute Nacht, Reinhard
  4. Hi, this is my first try with GdiPlus. I write a polyline on a transparent GUI (that works) and want to save it as bmp. But I don't get it saved. Only blank bmp. A little bit help would be fine, Reinhard #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <windowsconstants.au3> ;track data Bernepark (distance, elevation in meter) (x,y) $s = '' $s &= '0.0001,72;276,70;375,70;473,71;663,73;827,75;956,74;1556,74;1736,75;' $s &= '1954,76;2146,77;2449,77;2556,77;3000,75;3737,66;4124,56;4454,51;4686,47;4877,46;' $s &= '5243,39;5390,36;5478,34;5996,31;6886,35;7776,31;8565,34;8687,33;9298,35;9336,34;' $s &= '10379,34;10789,34;11095,33;11375,33;11491,35;11545,35;12129,37;12489,35;13034,35;13242,35;' $s &= '13421,36;13503,36;13606,34;13647,34;13718,35;14467,39;14625,46;15011,49;15154,58;15244,56;' $s &= '15358,56;15622,59;15704,63;15796,66;15838,69;15876,67;15921,68;15953,69;15986,71;16058,73;' $s &= '16083,73;16104,72;16124,72;16149,72;16171,72;16193,71;16375,70;16418,69;16439,70;16455,70;' $s &= '16499,72;16596,69;16717,65;16756,64;16805,64;16846,65;16886,68;16977,70;17046,70;17198,74;' $s &= '17245,74;17267,73;17295,72;17376,68;17427,66;17490,66;17566,68;17592,69;17763,70;17785,70;' $s &= '17846,70;18042,72;18076,73;18236,76;18306,76;18385,76;18544,76;18571,75;18709,75;18790,75' $s = stringstripWS($s,8) $ga = stringsplit($s,";") Dim $maxEle = 80 ;ytop Dim $minEle = 25 ;y0 Dim $maxMtr = 18790 Dim $minMtr = 0 Dim $gui_x = 205 Dim $gui_y = 60 Example() Func Example() Local $hGUI, $trkGraphic, $hPen ; Create transparent GUI $hGUI = GUICreate("GDI+", $gui_x, $gui_y, 41, 325, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST) GUISetBkColor(0x01, $hgui) _WinAPI_SetLayeredWindowAttributes($hgui, 0x01, 255) ;works with$WS_EX_LAYERED GUISetState(@SW_SHOW) ; Draw line _GDIPlus_Startup() $trkGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate(0x55000099,1) ;pen for frame $hPen2 = _GDIPlus_PenCreate(0xFFFF8060,3) ;pen for polyline ;draw a line in the middle ;;_GDIPlus_GraphicsDrawLine ( $trkGraphics, $nX1, $nY1, $nX2, $nY2 [, $hPen = 0] ) _GDIPlus_GraphicsDrawLine($trkGraphic, 0, $gui_y/2, $gui_x, $gui_y/2, $hPen) ;draw a frame _GDIPlus_GraphicsDrawLine($trkGraphic, 0, 0, $gui_x, 0, $hPen) _GDIPlus_GraphicsDrawLine($trkGraphic, 0, $gui_y-1, $gui_x, $gui_y-1, $hPen) _GDIPlus_GraphicsDrawLine($trkGraphic, $gui_x-1, $gui_y-1, $gui_x-1, 0, $hPen) _GDIPlus_GraphicsDrawLine($trkGraphic, 0, $gui_x-1, 1, 0, $hPen) ;draw the polyline for the track for $i = 1 to $ga[0]-2 $af = stringsplit($ga[$i], ",") $at = stringsplit($ga[$i+1], ",") $yf = (1 - (($af[2]-$minele) / ($maxele - $minele))) * $gui_y $xf = $af[1] / $maxMtr * ($gui_x) $yt = (1 - (($at[2]-$minele) / ($maxele-$minele))) * $gui_y $xt = $at[1] / $maxMtr * ($gui_x) ;msgbox(0,"", $xf &", " &$yf &", " &$yt &", "&$xt) _GDIPlus_GraphicsDrawLine($trkGraphic, $xf, $yf, $xt, $yt, $hPen2) next $trkImage = _GDIPlus_BitmapCreateFromGraphics ( $gui_x, $gui_y, $trkGraphic ) _GDIPlus_ImageSaveToFile($trkImage,@ScriptDir&"\test.bmp") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($trkGraphic) _GDIPlus_BitmapDispose($trkImage) _GDIPlus_Shutdown() EndFunc ;==>Example
  5. Hi, you could check the file association and get the executable. If the executable is Adobe Reader you can start it direct with the command line option /n. That means Reader will start the file in a new instance. If you find another PDF viewer you can start it also direct. If you find nothing you can give a hint or a link to a PDF viewer. br, Reinhard PS.: In cmd you can use "assoc .pdf" and then use the result in "ftype ....." to get the program, but I think I saw also examples here.
  6. Mmmh, here the simple way: in your html code set up a textfield like: <textarea id="eventMsg" style="width: 200px;height:20px;font:8pt" title="Important events"></textarea> In your html js.code put "eventMsg = document.getElementById('eventMsg');" into your startup-code. Replace your "alert" with something like: "eventMsg.value = 'myMsgToAutoIt'". Now we want to catch this event/msg in AutoIt for the embedded object Internet explorer ($oIE). So after $oIE.Navigate(....) and waitOnLoad (readyState = OK) call the following function. func addHtmlListener() DIM $mapEvent = $oIe.document.all.eventMsg objEvent($mapEvent,"mapEvent_") endfunc After the basics are done, we have to set up the mapEvent_ function in AutoIt to catch every change of the property of the html-textfield: func mapEvent_onPropertyChange() ;(text in html-eventMsg field has changed) ;; get the msg string $mapEvent_strg = $mapEvent.value ..... do something with the msg you got ..... EndFunc That's the simple solution and should work (like it works for my html page with Gmap API events). SmOke_N's example show you much more possibilities. Good luck, Reinhard @SmOke_N Thanks for the example.Saved it.
  7. no comments?? Where is the example? Only someone who need a polyglon, would take the time to set up an example (with an DB?) to see how it works. So if you have an example you may spend it also and everybody who interestest can have a short look how it works - if it*s works at all - and if he like it. best regards, Reinhard
  8. Hi, I'm not an expert for html, but belongs a style sheet not normaly to the header? In your code it hangs between header and body. You may have a look at the attached standard example. best regards, Reinhard <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>Link-Element for Stylesheets</title> <link rel="stylesheet" type="text/css" href="formate.css"> <style type="text/css"> /* ... your file specific formats ... */ </style> </head> <body> <h1>Link-Element for Stylesheets</h1> </body> </html>
  9. Hi, you can use a FDF file. That is a structured textfile, which you can write an execute using autoit. Have a look at this: bet regards, Reinhard
  10. Hi, in js/html you can choose an option via selectedIndex. So in autoit you can use something like: $index = 0 ;=first element $oIe.document.all.tegevus.selectedIndex = $index HTH, Reinhard
  11. Hi, you forgot to state the includes: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HTH, Reinhard
  12. Hi, I like Win7. Our Company will update from XP to Win7 in Sept./Oct. Because our IT want avoid problems all Notebook users will get a new one. That's exact the right time, because my Notebook is already just over 1 year old :-)) br, Reinhard PS: On my Desktop I have already Win7 (Testuser). Works fine, so far. I installed also Lotus 123 (WK4 - smartsuite '95). No problem. The only problem I see - as normal user - is to get new drivers for older Hardware.
  13. Hi, have a look in the helpfile on objEvent(). In html you may set up a (hidden) edit field with an onchange event. The onchange event you can catch, the value from the edit may tell you what happened if you have filled with html/js. There are some examples you will find here. Best regards, Reinhard Here a quick example: func mapAddListener() DIM $oMapEdit = $oIE.document.all.edit objEvent($oMapEdit,"oMapEditEvent_") endfunc func oMapEditEvent_onpropertychange() ... ... endfunc
  14. With autoIt (or other) you can communicate with HTML/JS using different methods: you can execute JS code e.g. $oIE.document.parentwindow.execScript("selBoxChangeColor()") you can get/set values e.g.: $sMapGet = $oIE.document.all.memo.value you can catch specific events, .. Is that what you wanted to know. You may have a look at the IE Management UDFs Best regards, Reinhard
×
×
  • Create New...