Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/04/2024 in all areas

  1. Andreik

    Title Bar Button

    I don't know what you saw but take a look here.
    1 point
  2. Example: #include <GDIPlus.au3> Global $hGUI = GUICreate("", 512, 512) _GDIPlus_Startup() $hTextureArrow = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\arrow.png") $iW = _GDIPlus_ImageGetWidth($hTextureArrow) $iH = _GDIPlus_ImageGetHeight($hTextureArrow) $iW2 = $iW / 2 $iH2 = $iH / 2 $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBitmap = _GDIPlus_BitmapCreateFromGraphics(512, 512, $hGraphic) $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) $hBitmap_Background = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\logo4.gif") $iW2_Bg = _GDIPlus_ImageGetWidth($hBitmap_Background) / 2 $iH2_Bg = _GDIPlus_ImageGetHeight($hBitmap_Background) / 2 $hBitmap_Arrow = _GDIPlus_BitmapCreateFromGraphics($iW, $iW, $hBackbuffer) $hGCArrow = _GDIPlus_ImageGetGraphicsContext($hBitmap_Arrow) $hMatrixArrow = _GDIPlus_MatrixCreate() GUISetState() While 1 Switch GUIGetMsg() Case -3 _GDIPlus_MatrixDispose($hMatrixArrow) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hGCArrow) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBitmap_Arrow) _GDIPlus_BitmapDispose($hTextureArrow) _GDIPlus_ImageDispose($hBitmap_Background) _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_Shutdown() Exit EndSwitch Rotate() WEnd Func Rotate() _GDIPlus_GraphicsClear($hBackbuffer, 0xFF6495ED) _GDIPlus_MatrixTranslate($hMatrixArrow, $iW2, $iW2) ; move it back to 0, 0 since (112 / 2) and (37 / 2) are it's middle origin point _GDIPlus_MatrixRotate($hMatrixArrow, 1) ; rotate it around it's middle origin point _GDIPlus_GraphicsSetTransform($hGCArrow, $hMatrixArrow) _GDIPlus_MatrixTranslate($hMatrixArrow, -$iW2, -$iW2) _GDIPlus_GraphicsClear($hGCArrow, 0x00000000) _GDIPlus_GraphicsDrawImageRect($hGCArrow, $hTextureArrow, -$iW2, -$iH2, $iW, $iH) ; place the arrow at the center of it's GC _GDIPlus_GraphicsDrawImage($hBackbuffer, $hBitmap_Background, (256 - $iW2_Bg), (256 - $iH2_Bg)) ; show the GC _GDIPlus_GraphicsDrawImage($hBackbuffer, $hBitmap_Arrow, 256 - $iW2, 256 - $iW2) ; move it's GC by an offset so the image is at the correct XY using it's origin _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, 512, 512) EndFunc Br, UEZ
    1 point
  3. OverloadUT

    HTTP UDF's

    I am working on a fairly large project and a big part of it is an AutoIt application that uploads a lot of data to a PHP script. For a while I was using INetGet and submitting all my data as GET variables in the URL. However, the amount of data to upload got too big (over 1000 characters) and the INetGet function started to fail. I also hated that INetGet ONLY works if the webserver responds with "200 OK" - There is no way to tell the difference between a 404 error and simply not being able to connect to the server in the first place. So I write this library of UDF's. Basically, it's a fully compliant HTTP/1.1 client. It uses only the TCP functions; no DllCall needed here! I had a blast learning all about the HTTP protocol and how to use it. Advantages over INetGet: The data is downloaded right in to variables instead of to files. You can of course then write this data to a file if you wish. You can read all of the headers supplied by the webserver. You can get the HTTP Response Code from the webserver. When it failes, you know exactly what failed instead of having to guess. ; =================================================================== ; HTTP UDF's ; v0.5 ; ; By: Greg "Overload" Laabs ; Last Updated: 07-22-06 ; Tested with AutoIt Version 3.1.1.131 ; Extra requirements: Nothing! ; ; A set of functions that allow you to download webpages and submit ; POST requests. ; ; Main functions: ; _HTTPConnect - Connects to a webserver ; _HTTPGet - Submits a GET request to a webserver ; _HTTPPost - Submits a POST request to a webserver ; _HTTPRead - Reads the response from a webserver ; =================================================================== I consider this UDF package to be a "beta" and that's why I call it version 0.5. However, I would love people to give it a try and tell me how it works for them. I have done extensive testing and I think I have the parser working perfectly. I plan on improving this library. It's possible that I might change the way the functions work (I don't think the _HTTPConnect function is necessary; I could move that functionality right in to the Get or Post functions.) To Do: Add a function that downloads the data right to a file. You might not want to download a 10 meg file in to memory before saving it to a file.Add a method to get the progress of the download. This will probably be in the form of a callback function, if that's possible in AutoIt.Add the ability to automatically follow "Location:" headers. Currently you'd have to do it manually.Other things I can't think of!Post #25 For Updated functions to work with current AutoIt versions.
    1 point
×
×
  • Create New...