Jump to content
Sign in to follow this  
Greek

ClonePicDown/Right

Recommended Posts

Greek

Hi,

i made this:

#include <GDIplus.au3>
#Include <ScreenCapture.au3>

_ClonePicDown(@DesktopDir&"\Bild2Druck.JPG", @DesktopDir&"\test.jpg")

Func _ClonePicDown($PfadZuBild,$PfadNeuerName)
    ; Greek
    _GDIPlus_Startup()
    $hImg1 = _GDIPlus_ImageLoadFromFile($PfadZuBild)
    $H=_GDIPlus_ImageGetHeight($hImg1)
    $W=_GDIPlus_ImageGetWidth($hImg1)
    $hGDIBitmap = _ScreenCapture_Capture("",0,0,$W,$H*2)
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hGDIBitmap)
    _WinAPI_DeleteObject($hGDIBitmap)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)

    $ImageAttributes = _GDIPlus_ImageAttributesCreate()
    _GDIPlus_GraphicsDrawImageRectRectAttr($hGraphic, $hImg1, 0, 0, $W, $H, 0, 0, $W, $H, 2, $ImageAttributes)
    _GDIPlus_GraphicsDrawImageRectRectAttr($hGraphic, $hImg1, 0, 0, $W, $H, 0, $H, $W, $H, 2, $ImageAttributes)
    _GDIPlus_ImageSaveToFile($hBitmap, $PfadNeuerName)

    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_ImageDispose($hImg1)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_ImageAttributesDispose($ImageAttributes)
    _GDIPlus_Shutdown()
EndFunc

Func _GDIPlus_GraphicsDrawImageRectRectAttr($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth, $iSrcHeight, $iDstX, $iDstY, $iDstWidth, $iDstHeight, $iUnit = 2, $pImageAttributes=0)
    Local $aResult
    $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "ptr", $hGraphics, "ptr", $hImage, "int", $iDstX, "int", _
            $iDstY, "int", $iDstWidth, "int", $iDstHeight, "int", $iSrcX, "int", $iSrcY, "int", $iSrcWidth, "int", _
            $iSrcHeight, "int", $iUnit, "ptr", $pImageAttributes, "ptr", 0, "ptr", 0)
    If @error Then Return SetError(@error, @extended, False)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc   ;==>_GDIPlus_GraphicsDrawImageRectRectAttr

Func _GDIPlus_ImageAttributesCreate()
    ; Prog@ndy
    Local $aResult = DllCall($ghGDIpDLL, "int", "GdipCreateImageAttributes", "ptr*", 0)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0],0,$aResult[1])
EndFunc

Func _GDIPlus_ImageAttributesDispose($pImageAttributes)
    ; Prog@ndy
    Local $aResult = DllCall($ghGDIpDLL, "int", "GdipDisposeImageAttributes", "ptr", $pImageAttributes)
    If @error Then Return SetError(1,@error,0)
    Return SetError($aResult[0],0,$aResult[0]=0)
EndFuncoÝ÷ Ù«­¢+Ø¥¹±Õ±Ðí%Á±Õ̹ÔÌÐì(%¹±Õ±ÐíMɹ
ÁÑÕɹÔÌÐì()}
±½¹A¥I¥¡Ð¡Í­Ñ½Á¥ÈµÀìÅÕ½ÐìÀäÈí    ¥±ÉÉÕ¬¹)AÅÕ½Ðì°Í­Ñ½Á¥ÈµÀìÅÕ½ÐìÀäÈíÑÍй©ÁÅÕ½Ðì¤()Õ¹}
±½¹A¥I¥¡Ð ÀÌØíAiÕ   ¥±°ÀÌØíA9ÕÉ9µ¤($ìɬ(%}%A±ÕÍ}MÑÉÑÕÀ ¤($ÀÌØí¡%µÄô}%A±ÕÍ}1½É½µ¥± ÀÌØíAiÕ   ¥±¤($ÀÌØí õ}%A±ÕÍ}%µÑ!¥¡Ð ÀÌØí¡%µÄ¤($ÀÌØíõ}%A±ÕÍ}%µÑ]¥Ñ  ÀÌØí¡%µÄ¤($ÀÌØí¡% ¥ÑµÀô}Mɹ
ÁÑÕÉ}
ÁÑÕÉ ÅÕ½ÐìÅÕ½Ðì°À°À°ÀÌØí¨È°ÀÌØí ¤($ÀÌØí¡    ¥ÑµÀô}%A±ÕÍ}    ¥ÑµÁ
ÉÑɽµ! %Q5@ ÀÌØí¡%    ¥ÑµÀ¤(%}]¥¹A%}±Ñ=©Ð ÀÌØí¡%  ¥ÑµÀ¤($ÀÌØí¡ÉÁ¡¥ô}%A±ÕÍ}%µÑÉÁ¡¥Í
½¹ÑáÐ ÀÌØí¡   ¥ÑµÀ¤(($ÀÌØí%µÑÑÉ¥ÕÑÌô}%A±ÕÍ}%µÑÑÉ¥ÕÑÍ
ÉÑ ¤(}%A±ÕÍ}ÉÁ¡¥ÍÉÝ%µIÑIÑÑÑÈ ÀÌØí¡ÉÁ¡¥°ÀÌØí¡%µÄ°À°À°ÀÌØí°ÀÌØí °À°À°ÀÌØí°ÀÌØí °È°ÀÌØí%µÑÑÉ¥ÕÑ̤(%}%A±ÕÍ}ÉÁ¡¥ÍÉÝ%µIÑIÑÑÑÈ ÀÌØí¡ÉÁ¡¥°ÀÌØí¡%µÄ°À°À°ÀÌØí°ÀÌØí °ÀÌØí°À°ÀÌØí°ÀÌØí °È°ÀÌØí%µÑÑÉ¥ÕÑ̤(%}%A±ÕÍ}%µMÙQ½¥± ÀÌØí¡    ¥ÑµÀ°ÀÌØíA9ÕÉ9µ¤((%}%A±ÕÍ}ÉÁ¡¥Í¥ÍÁ½Í ÀÌØí¡ÉÁ¡¥¤(%}%A±ÕÍ}%µ¥ÍÁ½Í ÀÌØí¡%µÄ¤(%}%A±ÕÍ}  ¥ÑµÁ¥ÍÁ½Í ÀÌØí¡   ¥ÑµÀ¤(}%A±ÕÍ}%µÑÑÉ¥ÕÑÍ¥ÍÁ½Í ÀÌØí%µÑÑÉ¥ÕÑ̤(%}%A±ÕÍ}M¡Õѽݸ ¤)¹Õ¹()Õ¹}%A±ÕÍ}ÉÁ¡¥ÍÉÝ%µIÑIÑÑÑÈ ÀÌØí¡ÉÁ¡¥Ì°ÀÌØí¡%µ°ÀÌØí¥MÉ`°ÀÌØí¥MÉd°ÀÌØí¥MÉ]¥Ñ °ÀÌØí¥MÉ!¥¡Ð°ÀÌØí¥ÍÑ`°ÀÌØí¥ÍÑd°ÀÌØí¥ÍÑ]¥Ñ °ÀÌØí¥ÍÑ!¥¡Ð°ÀÌØí¥U¹¥ÐôÈ°ÀÌØíÁ%µÑÑÉ¥ÕÑÌôÀ¤(1½°ÀÌØíIÍÕ±Ð(ÀÌØíIÍÕ±Ðô±±
±° ÀÌØí¡%A±°°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí¥ÁÉÝ%µIÑIÑ$ÅÕ½Ðì°ÅÕ½ÐíÁÑÈÅÕ½Ðì°ÀÌØí¡ÉÁ¡¥Ì°ÅÕ½ÐíÁÑÈÅÕ½Ðì°ÀÌØí¡%µ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥ÍÑ`°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°|(ÀÌØí¥ÍÑd°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥ÍÑ]¥Ñ °ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥ÍÑ!¥¡Ð°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥MÉ`°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥MÉd°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥MÉ]¥Ñ °ÅÕ½Ðí¥¹ÐÅÕ½Ðì°|(ÀÌØí¥MÉ!¥¡Ð°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥U¹¥Ð°ÅÕ½ÐíÁÑÈÅÕ½Ðì°ÀÌØíÁ%µÑÑÉ¥ÕÑÌ°ÅÕ½ÐíÁÑÈÅÕ½Ðì°À°ÅÕ½ÐíÁÑÈÅÕ½Ðì°À¤(%ÉɽÈQ¡¸IÑÕɸMÑÉɽȡÉɽȰáѹ°±Í¤(IÑÕɸMÑÉÉ½È ÀÌØíIÍÕ±ÑlÁt°À°ÀÌØíIÍÕ±ÑlÁtôÀ¤)¹Õ¹ìôôÐí}%A±ÕÍ}ÉÁ¡¥ÍÉÝ%µIÑIÑÑÑÈ()Õ¹}%A±ÕÍ}%µÑÑÉ¥ÕÑÍ
ÉÑ ¤(ìAɽ¹ä(1½°ÀÌØíIÍÕ±Ðô±±
±° ÀÌØí¡%Á10°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí¥Á
ÉÑ%µÑÑÉ¥ÕÑÌÅÕ½Ðì°ÅÕ½ÐíÁÑȨÅÕ½Ðì°À¤(%ÉɽÈQ¡¸IÑÕɸMÑÉÉ½È Ä±ÉɽȰÀ¤(IÑÕɸMÑÉÉ½È ÀÌØíIÍÕ±ÑlÁt°À°ÀÌØíIÍÕ±ÑlÅt¤)¹Õ¹()Õ¹}%A±ÕÍ}%µÑÑÉ¥ÕÑÍ¥ÍÁ½Í ÀÌØíÁ%µÑÑÉ¥ÕÑ̤(ìAɽ¹ä(1½°ÀÌØíIÍÕ±Ðô±±
±° ÀÌØí¡%Á10°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí¥Á¥ÍÁ½Í%µÑÑÉ¥ÕÑÌÅÕ½Ðì°ÅÕ½ÐíÁÑÈÅÕ½Ðì°ÀÌØíÁ%µÑÑÉ¥ÕÑ̤(%ÉɽÈQ¡¸IÑÕɸMÑÉÉ½È Ä±ÉɽȰÀ¤(IÑÕɸMÑÉÉ½È ÀÌØíIÍÕ±ÑlÁt°À°ÀÌØíIÍÕ±ÑlÁtôÀ¤)¹Õ¹

I tried to get a good speed!

Hope someone need it :D

Greek

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.