2 posts in this topic
Create water effects using waterctrl.dll.
I'm trying to use '?do=embed' frameborder='0' data-embedContent>> but none of the examples work. Mostly, I'm just not seeing any pictures, just nothing, a window with some text but no picture. What am I doing wrong? Do these examples work for anybody else?
I'd like to load a BMP file then change chosen color (0xFF00FF) to transparent and save it as PNG file. I'm using a code from other thread. I've modified it a little, but it still doesn't work.
My program displays image with transparent color correctly, however saves a black image file.
#include <Constants.au3> #include <WinAPIEx.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> Global Const $STM_SETIMAGE = 0x0172 Global Const $STM_GETIMAGE = 0x0173 $hForm = GUICreate('MyGUI', 400, 400) $Pic = GUICtrlCreatePic('', 50, 50, 144, 87) $hPic = GUICtrlGetHandle(-1) _GDIPlus_Startup() $hDstDC = _WinAPI_CreateCompatibleDC(0) $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_3DFACE), 144, 87, 0) $hDstSv = _WinAPI_SelectObject($hDstDC, $hBitmap) $hSrcDC = _WinAPI_CreateCompatibleDC(0) $hImg = _WinAPI_LoadImage(0, @ScriptDir & '\piclvq.bmp', $IMAGE_BITMAP, 0, 0, $LR_LOADFROMFILE) $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hImg) _WinAPI_TransparentBlt($hDstDC, 0, 0, 144, 87, $hSrcDC, 0, 0, 144, 87, 0xFF00FF) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hForm) $hImage = _GDIPlus_BitmapCreateFromGraphics(144, 87, $hGraphic) ; Save resultant image _GDIPlus_ImageSaveToFile($hImage, "My_transparent_image.png") _WinAPI_SelectObject($hDstDC, $hDstSv) _WinAPI_DeleteDC($hDstDC) _WinAPI_SelectObject($hSrcDC, $hSrcSv) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hImg) _WinAPI_DeleteObject(_SendMessage($hPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)) $hPic = _SendMessage($hPic, $STM_GETIMAGE) If $hPic <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf GUISetState() Do Until GUIGetMsg() = -3 piclvq.bmp
Hello all. I am trying to figure out the best approach to compare PDF outputs for consistency. Currently, this is a human task where PDFs are held up to a light to see if all the values line up exactly with test data. I have to believe there is a better way. That said GDIPlus is a bit of a mystery to me - I have looked at some of the functions - and I stumbled upon >this very useful script in my forum search. My question is: would converting the PDF to an image and comparing the image with GDIPlus be the way to go or is there a different more efficient approach that you would recommend? Any guidance would be greatly appreciated.
Here's a simple script I'm testing the ScreenCapture function with.
#include <ScreenCapture.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> ; Capture region _ScreenCapture_Capture(@ScriptDir & "\image.bmp", 290,18,1465,652,0) $form=GUICreate("Test",1175,634,290,18,BitOR($WS_SYSMENU,$WS_POPUP),$WS_EX_COMPOSITED) $PSimage=GUICtrlCreatePic(@ScriptDir & "\image.bmp", 0,0,1175,634) GUISetState(@SW_SHOW) MsgBox(0,"","Test of screen cap and display.") .
The above script captures an area of the screen (the SciTE editor with this script open), writes it to image.bmp, and displays image.bmp. The problem I'm having is when image.bmp is displayed using GUICtrlCreatePic the result is fuzzy. Here's a SnagIt screen capture of what GUICtrlCreatePic displays.
Attached is image.bmp, which is sharp and equivalent to seeing the actual script open in SciTE on-screen.
Any suggestions for displaying an accurate rendition of ScreenCapture's output? (Must be borderless, no chrome, etc. -- equivalent to what my test script yields.)