komalo Posted August 26, 2008 Share Posted August 26, 2008 Hi I was wondering if there's a way to blur an image, I tried using GDI+ Graphic Functions But I can't save it and it All blurring happens on the screen only, tried prospeed but I couldn't understand it, finally Searched the internet looking for an image blur tool with no success. also , i wanted to know if there's a way to use a bitmap resource in dll thanx in advance [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 26, 2008 Share Posted August 26, 2008 Try blurring the image then using _ScreenCapture_CaptureWnd() to save the image. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
komalo Posted August 26, 2008 Author Share Posted August 26, 2008 (edited) well i use this now but i was wondering if there's another waythe code i am using got it from here :#458911 Edited August 26, 2008 by komalo [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
jpam Posted August 26, 2008 Share Posted August 26, 2008 change autoit_builder_wall_800x600.jpg with your own picture #include <Prospeed30.au3> Opt("GUIOnEventMode", 1) HotKeySet("{Esc}","_Exit") $Gui = GUICreate("Blur", 800, 600) GUISetOnEvent(-3, "_exit") GUISetState() $hdc = GetHDC() $image = LoadFileImage("autoit_builder_wall_800x600.jpg") $array = InitFx($image) For $i = 1 To 50 blur($hdc,0,0,$array) Sleep(10) Next While 1 Sleep(1000) WEnd Func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
komalo Posted August 27, 2008 Author Share Posted August 27, 2008 thanx man but this draws blur on the screen and i want to be in file any way i will keep modifying on this script until i make blur the image in the file [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
jpam Posted August 27, 2008 Share Posted August 27, 2008 saves the effect as jpg or bmp to disk #include <Prospeed30.au3> Opt("GUIOnEventMode", 1) $Gui = GUICreate("blur", 800, 600) GUISetState() $hdc = GetHDC() $image = LoadFileImage("autoit_builder_wall_800x600.jpg") $array = InitFx($image) $bitmap = CreateImage(800,600) For $i = 1 To 30 blur($bitmap,0,0,$array) Next ;SaveImage(bitmapdata, "path+filename", bmp/jpg, Quality for jpg format) SaveImage($bitmap, "C:\blurpicture.jpg", 1, 10) ; save as jpg ;SaveImage($bitmap, "C:\blurpicture.bmp", 0, 10) ; save as bmp Exit Link to comment Share on other sites More sharing options...
rasim Posted August 27, 2008 Share Posted August 27, 2008 Hmm...very interesting, example with GDIPlus, technique is to resize the original image to a MUCH SMALLER size, and then resize it to the original size expandcollapse popup#include <GDIPlus.au3> _GDIPlus_Startup() $file = "c:\runner.jpg" $ResFile = _ImageResize($file) _GDIPlus_Shutdown() Func _ImageResize($sFile, $sReduce = 2) Local $hSourceIMG, $iWidth, $iHeight, $hBitmap, $hImage, $hGraphics, $iOutput = @ScriptDir & "\reduced.jpg" $hSourceIMG = _GDIPlus_ImageLoadFromFile($sFile) $iWidth = _GDIPlus_ImageGetWidth($hSourceIMG) $iHeight = _GDIPlus_ImageGetHeight($hSourceIMG) $hBitmap = _CreateBMP($iWidth / $sReduce, $iHeight / $sReduce) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPLus_GraphicsDrawImageRect($hGraphics, $hSourceIMG, 0, 0, $iWidth / $sReduce, $iHeight / $sReduce) _GDIPlus_ImageSaveToFile($hImage, $iOutput) _WinAPI_DeleteObject($hBitmap) _GDIPlus_ImageDispose($hSourceIMG) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) $hSourceIMG = _GDIPlus_ImageLoadFromFile($iOutput) $hBitmap = _CreateBMP($iWidth, $iHeight) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPLus_GraphicsDrawImageRect($hGraphics, $hSourceIMG, 0, 0, $iWidth, $iHeight) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\blur_factor" & $sReduce & ".jpg") _WinAPI_DeleteObject($hBitmap) _GDIPlus_ImageDispose($hSourceIMG) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) FileDelete($iOutput) EndFunc ;==>_ImageResize Func _CreateBMP($sWidth, $sHeight) Local $hWnd = _WinAPI_GetDesktopWindow() Local $hDC = _WinAPI_GetDC($hWnd) Local $hBMP = _WinAPI_CreateCompatibleBitmap($hDC, $sWidth, $sHeight) _WinAPI_ReleaseDC($hWnd, $hDC) Return $hBMP EndFunc ;==>_CreateBMPOriginal:blur by factor 2blur by factor 3blur by factor 4 Link to comment Share on other sites More sharing options...
komalo Posted August 28, 2008 Author Share Posted August 28, 2008 thank you all i got it work [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
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