Hallo,
mal 2 Beispielscripte, ich hab gerade nen Gehirnkrampf und komme nicht weiter....
Wie bekomme ich die die BITMAPS (innerhalb des Fensters) gespeichert...
Spoiler anzeigen
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]_Main()
[/autoit] [autoit][/autoit] [autoit]Func _Main()
Local $hGUI, $hWnd, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout
; Create GUI
$hGUI = GUICreate("GDI+", 400, 300)
$hWnd = WinGetHandle("GDI+")
GUISetState()
; Draw a string
_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
$hBrush = _GDIPlus_BrushCreateSolid (0x7F00007F)
$hFormat = _GDIPlus_StringFormatCreate ()
$hFamily = _GDIPlus_FontFamilyCreate ("Arial")
$hFont = _GDIPlus_FontCreate ($hFamily, 12, 2)
$tLayout = _GDIPlus_RectFCreate (140, 110, 100, 20)
_GDIPlus_GraphicsDrawStringEx ($hGraphic, "Hello world", $hFont, $tLayout, $hFormat, $hBrush)
;*********************Bitmap soll gespeichert werden********************
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_FontDispose ($hFont)
_GDIPlus_FontFamilyDispose ($hFamily)
_GDIPlus_StringFormatDispose ($hFormat)
_GDIPlus_BrushDispose ($hBrush)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown ()
EndFunc ;==>_Main
[/autoit]
oder hier....
Spoiler anzeigen
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]local $hfile_Source = _GDIPlus_ImageLoadFromFile(@WindowsDir & "\web\wallpaper\Tulpen.jpg")
local $hfile_dest = _GDIPlus_ImageLoadFromFile(@WindowsDir & "\web\wallpaper\Mondkrater.jpg")
local $iX1 = 300;_GDIPlus_ImageGetWidth($hSource1)
local $iY1 = 400;_GDIPlus_ImageGetHeight($hSource1)
local $iX2 = 300;_GDIPlus_ImageGetWidth($hSource2)
local $iY2 = 400;_GDIPlus_ImageGetHeight($hSource2)
;****************GUI DEST*******************
local $hGui_dest = GUICreate("DEST", $iX1 , $iY1)
local $hPic_dest = GUICtrlCreatePic('', 0,0, $iX1 , $iY1)
local $hWnd_dest = WinGetHandle($hGui_dest)
GUISetState(@sw_show,$hgui_dest)
local $hGraphic_dest = _GDIPlus_GraphicsCreateFromHWND($hWnd_dest)
local $hDestination_dest = _GDIPlus_BitmapCreateFromGraphics($iX1, $iY1, $hGraphic_dest)
local $hGraphiccontext_dest = _GDIPlus_ImageGetGraphicsContext($hDestination_dest)
_GDIPlus_GraphicsDrawImage($hGraphiccontext_dest, $hfile_dest, 0, 0) ;ziel in context schreiben
_GDIPlus_GraphicsDrawImage($hGraphic_dest, $hfile_dest, 0, 0); ziel ist fenster
;****************GUI source*******************
local $hGui_source = GUICreate("SOURCE", $iX2 , $iY2,10,10)
local $hPic_source = GUICtrlCreatePic('', 0,0, $iX2 , $iY2)
local $hWnd_source = WinGetHandle($hGui_source)
GUISetState(@sw_show,$hgui_source)
local $hGraphic_source = _GDIPlus_GraphicsCreateFromHWND($hWnd_source)
local $hDestination_source = _GDIPlus_BitmapCreateFromGraphics($iX2, $iY2, $hGraphic_source)
local $hGraphiccontext_source = _GDIPlus_ImageGetGraphicsContext($hDestination_source)
_GDIPlus_GraphicsDrawImage($hGraphiccontext_source, $hfile_Source, 0, 0) ;wenn man das bild in den Context schreibt, kann man es speichern
_GDIPlus_GraphicsDrawImage($hGraphic_source, $hfile_Source, 0, 0) ;bild in das Fenster zeichnen
;*************BITBLT*****************
local $verfahren=$mergepaint
local $hdc_dest = _WinAPI_GetDC($hgui_dest)
local $hdc_source = _WinAPI_GetDC($hgui_source)
sleep(1000)
_WinAPI_BitBlt($hDC_dest, 0, 0, $ix1, $iy1, $hDC_source, 0,0, $verfahren)
;**************BITMAP aus Fenster DEST soll gespeichert werden**************
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Do
Until GUIGetMsg() = -3
_GDIPlus_Shutdown()
[/autoit]thx vorab
Andy
EDIT/ soll nicht per screencopy, sondern "direkt aus dem Context gespeichert werden