Search the Community
Showing results for tags 'jpg'.
-
Hello everyone , Text translated from Portuguese by google - please apologize for any errors Once again I need a light from the gurus of this wonderful website I am fanatic by combobox for its usability but I am not able to uncertain images within lists ... I know uncertain icons, and cursors but I am not able to insert gif or jpg images. 1) How to solve this ... 2) will the path is to convert gif into bmp and then uncertain ... how to do that? #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> ;dados de mouse #include <WinAPIRes.au3> ;COMBO #include <GuiComboBoxEx.au3> ;Fonts #include <FontConstants.au3> ;obter imagem de arquivo #include <GDIPlus.au3> #include <WinAPIGdi.au3> Example() Func Example() Local $hGUI, $hImage, $hCombo, $hFont Local $idListview, $hImage Local $sWow64 = "" Local $Pasta = "C:\WINDOWS\Cursors\3dgarro.cur" Local $PastaROMs = @MyDocumentsDir & "\Stella\ROMs\" ;com barra no final $hGUI = GUICreate("ImageList", 500, 310) GUISetFont(14, 400, 0, "Arial") ;<<<<<<<<<<this does not work for _GUICtrlComboBoxEx_Create $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 494, 200) ;GUICtrlSetFont($hCombo, 14, 400, 0, "Arial");<<<<<<<<<<It does not work ; ;Create a handle to a font object $hFont = _WinAPI_CreateFont(30, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Arial') ;Pass the handle to _WinAPI_SetFont _WinAPI_SetFont($hCombo, $hFont) $idListview = GUICtrlCreateListView("", 2, 50, 494, 250, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUISetState(@SW_SHOW) ; Initialize GDI+ library _GDIPlus_Startup() ; Load images $hImage = _GUIImageList_Create(120, 70, 6, 2) ;32,32,5,5) ; $DadosCombo = "Escolha|" & _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x0000FF, 120, 70)) ;Local $aCursors[] = [32650, 32512, 32515, 32649, 32651, 32513, 32648, 32646, 32643, 32645, 32642, 32644, 32516, 32514] For $i = 1 To 10 $sFile = FileOpenDialog("Please select an image", $PastaROMs, "Image (*.jpg;*.png;*.bmp;*.gif;*.tif)", BitOR($FD_PATHMUSTEXIST, $FD_FILEMUSTEXIST)) If @error Then Exit MsgBox(BitOR($MB_TOPMOST, $MB_ICONERROR), "Error", "No image file has been selected", 30) $a = _GDIPlus_BitmapCreateFromFile ($sFile);<<<<< ok If @error Or Not $hImage Then MsgBox(BitOR($MB_TOPMOST, $MB_ICONERROR), "Error", "This file isn't supported by GDIPlus!") Else $b=_GUIImageList_Add($hImage, $a);<<<<<< Return -1 $DadosCombo &= "|" & $i & "_img_princ.gif""|" & $b EndIf Next _GUICtrlListView_SetImageList($idListview, $hImage, 1) _GUICtrlComboBoxEx_SetImageList($hCombo, $hImage) ; Add columns _GUICtrlListView_AddColumn($idListview, "Icons - Mouses", 350) ; Add items $a = StringSplit($DadosCombo, "|") For $i = 1 To $a[0] Step 2 _GUICtrlListView_AddItem($idListview, $a[$i], $a[$i + 1]) _GUICtrlComboBoxEx_AddString($hCombo, $a[$i], $a[$i + 1], $a[$i + 1]) Next ;AutoIt_Debugger_Command:Disable_Debug ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() ;AutoIt_Debugger_Command:Enable_Debug EndFunc ;==>Example tks
-
Hey I'm not really familliar with GDI Plus , I am looking for how tocConvert a bitmap image to JPG in memory without saving it to disk Because I want to send it later via TCP directly without using FileRead and other stuff .. The only function I found is below but it saves the image in disk Func SaveBmp2JPG($Bitmap, $sSave = "Converted.jpg", $iQuality = 20) ;coded by UEZ 2013 If Not IsPtr($Bitmap) Then $Bitmap = _GDIPlus_ImageLoadFromFile($sFile) If @error Then Return SetError(1, 0, 0) EndIf Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG") Local $tParams = _GDIPlus_ParamInit(1) Local $tData = DllStructCreate("int Quality") Local $pData = DllStructGetPtr($tData) Local $pParams = DllStructGetPtr($tParams) DllStructSetData($tData, "Quality", $iQuality) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) If Not _GDIPlus_ImageSaveToFileEx($Bitmap, $sSave, $sCLSID, $pParams) Then Return SetError(2, 0, 0) Return True EndFunc what my code now looks like : #include <ScreenCapture.au3> #include <guiconstantsex.au3> #include <gdiplus.au3> #include <memory.au3> #include <staticconstants.au3> Global $ghGDIPDLL = $__g_hGDIPDll Example() Func Example() _GDIPlus_Startup() Local $hHBmp = _ScreenCapture_Capture("") ;create a GDI bitmap by capturing my desktop Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap _WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore Local $hBitmap_Scaled2 = _GDIPlus_ImageResize($hBitmap, @DesktopWidth / 1.5, @DesktopHeight / 1.5) ;resize image SaveBmp2JPG($hBitmap_Scaled2,'Test.jpg',99) ; ===> Saving to disk ?? _GDIPlus_Shutdown() EndFunc ;==>Example Func SaveBmp2JPG($Bitmap, $sSave , $iQuality) ;coded by UEZ 2013 If Not IsPtr($Bitmap) Then $Bitmap = _GDIPlus_ImageLoadFromFile($sFile) If @error Then Return SetError(1, 0, 0) EndIf Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG") Local $tParams = _GDIPlus_ParamInit(1) Local $tData = DllStructCreate("int Quality") Local $pData = DllStructGetPtr($tData) Local $pParams = DllStructGetPtr($tParams) DllStructSetData($tData, "Quality", $iQuality) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) If Not _GDIPlus_ImageSaveToFileEx($Bitmap, $sSave, $sCLSID, $pParams) Then Return SetError(2, 0, 0) Return True EndFunc
- 17 replies
-
- screenshot
- gdiplus
-
(and 3 more)
Tagged with:
-
Is there any API or functions to convert all office documents(excel,word,ppt,etc) and pdf to images (jps,bmp or convert any animation in ppt to swf or gif). It should convert all the pages in the document to individual image files. Please help me on this.
-
Load web jpg/jpeg/png into _GUIImageList
NassauSky posted a topic in AutoIt General Help and Support
Thanks to the help of a couple forum members I got a web png loaded onto a button. I also want to do this with an image list. *Jump to the last code snippet (Slim Version) if you want to just see what I have so far. Here is a basic example image list that works from locally stored bmp files. I would like to replace the bitmaps with jpegs or png's from the internet: #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Example() Func Example() Local $idListview, $hImage Local $sWow64 = "" If @AutoItX64 Then $sWow64 = "\Wow6432Node" Local $sPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\Advanced\Images" GUICreate("ImageList AddBitmap", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUISetState(@SW_SHOW) ; Load images $hImage = _GUIImageList_Create(16, 32) _GUIImageList_AddBitmap($hImage, $sPath & "\Red.bmp") _GUICtrlListView_SetImageList($idListview, $hImage, 1) ; Add columns _GUICtrlListView_AddColumn($idListview, "Items", 120) ; Add items _GUICtrlListView_AddItem($idListview, "Item 1", 0) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example I tried integrating code from the working button example below that grabs a png file #include <GDIplus.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> _GDIPlus_Startup() Global $myImage = "http://icons.iconarchive.com/icons/hopstarter/soft-scraps/64/User-Administrator-Blue-icon.png" Global $GDIbmpLarge = _GDIPlus_BitmapCreateFromMemory(InetRead($myImage), 1) ;this is a GDI bitmap Global $GDIplusLarge = _GDIPlus_BitmapCreateFromHBITMAP($GDIbmpLarge) ;convert GDI to GDIPlus bitmap Global $hGUI = GUICreate("Bitmap from inet", 540, 396, -1, -1) GUISetBkColor(0xFFFFFF) Global $iBtnL = GUICtrlCreateButton("", 65, 89, 72, 72, $BS_BITMAP) , $hBtnL = GUICtrlGetHandle($iBtnL) _WinAPI_DeleteObject(_SendMessage($hBtnL, $BM_SETIMAGE, $IMAGE_BITMAP, $GDIbmpLarge)) ;this needs a GDI bitmap!!! GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GDIPlus_BitmapDispose($GDIplusLarge) _WinAPI_DeleteObject($GDIbmpLarge) _GDIPlus_Shutdown() GUIDelete() Exit Case $iBtnL MsgBox(0, "Info", "Large Image Downloaded from web and used directly without saving to disk first!") EndSwitch Until False Here is what I tried but it doesn't work: #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GDIplus.au3> ; Needed for GDI functions Example() Func Example() Local $idListview, $hImage Local $sWow64 = "" If @AutoItX64 Then $sWow64 = "\Wow6432Node" Local $sPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\Advanced\Images" GUICreate("ImageList AddBitmap", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUISetState(@SW_SHOW) ; Load images $hImage = _GUIImageList_Create(16, 32) $webImage = "http://icons.iconarchive.com/icons/hopstarter/soft-scraps/64/User-Administrator-Blue-icon.png" ; This line works-> _GUIImageList_AddBitmap($hImage, $sPath & "\Red.bmp") Global $GDIbmpLarge = _GDIPlus_BitmapCreateFromMemory(InetRead($webImage), 1) ;this is a GDI bitmap Global $GDIplusLarge = _GDIPlus_BitmapCreateFromHBITMAP($GDIbmpLarge) ;convert GDI to GDIPlus bitmap ; This doesn't work -> _GUIImageList_AddBitmap($hImage, _GDIPlus_BitmapCreateFromHBITMAP($GDIbmpLarge)) ; This doesn't work -> _GUIImageList_AddBitmap($hImage, _GDIPlus_BitmapCreateFromHBITMAP($GDIplusLarge)) _GUICtrlListView_SetImageList($idListview, $hImage, 1) ; Add columns _GUICtrlListView_AddColumn($idListview, "Items", 120) ; Add items _GUICtrlListView_AddItem($idListview, "Item 1", 0) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example *Slim version (No comments) #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GDIplus.au3> Example() Func Example() Local $idListview, $hImage GUICreate("ImageList AddBitmap", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUISetState(@SW_SHOW) ; Load images $hImage = _GUIImageList_Create(16, 32) $webImage = "http://icons.iconarchive.com/icons/hopstarter/soft-scraps/64/User-Administrator-Blue-icon.png" Global $GDIbmpLarge = _GDIPlus_BitmapCreateFromMemory(InetRead($webImage), 1) ;this is a GDI bitmap Global $GDIplusLarge = _GDIPlus_BitmapCreateFromHBITMAP($GDIbmpLarge) ;convert GDI to GDIPlus bitmap ; This doesn't work -> _GUIImageList_AddBitmap($hImage, _GDIPlus_BitmapCreateFromHBITMAP($GDIplusLarge)) _GUICtrlListView_SetImageList($idListview, $hImage, 1) _GUICtrlListView_AddColumn($idListview, "Items", 120) _GUICtrlListView_AddItem($idListview, "Item 1", 0) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc -
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. JFish
-
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 have been using GDIPlus to do a lot of image manipulation and love the flexablity it gives me when combined with autoit. I am stumped on my most recent project. That takes a single image and makes it into many that form a tiled structure that can be used in a flash program to put a person in a virtural tour. I have a test one to compare to to make sure that I am doing everything right. My script will make all of the tiles the perfect size, and will look just like the sample. But when I load it into the flash program lines show up around the edges of the cubes and the flash program takes longer to figure out to display it. Even though the compression and file types are the same. I have uploaded photos from both to http://www.imageforensic.org The only difference that it can see is that sample is in JFIF Specification 1.02, where as the files created by GDIPlus are JFIF standard 1.01. Anyone have any ideas how I can save .jpg files in JFIF Standard 1.02 with Autoit? I would like to use GDIPlus as I already have it working, but if I need to I will use any library that gets the job done. Thanks, Brandan
-
Hi there I feel confident that this is possible, and I have searched, but am unable to find how to do this. Brief: My database contains blobs which represent attachments that users have attached. I have a button "open attachment". This button should then, well, open the attachment using whatever programme is defined in the registry as the default programme to open the attachment. WHere I have got to: I can attach the blob. I can then write it out to a temporary directory using the original file name. I can get the file type from the registry using the extension of the filename I write out. What I can't figure out how to do: Lookup the registry and get the associated programme based on the filetype to launch the file. All help appreciated Clark
- 3 replies
-
- File association
- extension
- (and 4 more)
-
Hi all I am wondering if someone knows what could be causing the images in my GUI to display little black squares all over them. They seem to change depending on how much code is in the file/program. I have attached two examples, the first is from a set of buttons called using GUICtrlCreatePic and they are in BMP format Shows a screenshot of the GUI image on the left and the original images on the right The second is also called using GUICtrlCreatePic but they are in JPG format Shows a screenshot of the GUI image on the top and the original image on the bottom Both of them display the same problem although in earlier versions of the code it seemed to just exist on the BMP buttons, although i havent been watching it closely until i noticed them in both places today. They show up whether the script is compiled or not. Thanks in advance Adam
-
Identicon.au3 v0.8 A simple UDF to create identicons or visual representations of any hash value. Based on Don Park's original Identicon program. Main features: 3x3 and 4x4 grid patterns.Aside from rotational symmetry there are also checkerboard and Space Invader (mirror symmetry) patterns.Adapted to handle hashes up to SHA512.Save as PNG, JPG, GIF or BMP identicons.Alpha-transparency support for PNG.The UDF and a demo:Identicon.au3 Identicon-Demo.au3 Version 0.8: * Initial public release. To do: * In the checkerboard pattern there is a bias for diamond shapes. * Improve image saving, BMP, GIF and JPG suck, much artifacts and dithering. * Transparency doesn't work with GIF (and BMP?) due to the wrong Bitmap format. * Add some more unique sprite shapes and preferably cap the shape arrays at powers of two as BitAND is faster than a modulus operation.
-
I know there are snippet threads, but I'd like this one to be specific. I've see quite a few neat GDI+ code snippets (UEZ and Progandy come to mind first) to manipulate, create, etc, and I thought it'd be neat to be able to find them under one thread. I'm going to reserve the next 3 posts because I'm unsure at the moment if it's the "Quote" or "Spoiler" bbcode tags that has the 10 limit. You can link or post the snippets you find or create and I'll title them and put them in the threads for everyone to find. ( Going to have to remember to edit with regular editor! ) Some of these may not have titles, so I may create my own, if the author(s) want(s) a different one, let me know. _GDIPlus_WaterMark.au3 - Author: UEZ - Added: 2012-10-13 - Updated: _GDIPlus_BMPFromMemory – Author UEZ – Added: 2012-10-14 – Updated: Example – Needle Movement (4bit example provided, link to 32bit found in code) – Author: UEZ - Added: 2012-10-14 – Updated: