get last Item Count (will be used as an internal Id in both RT_ICON and RT_GROUP_ICON) Equtes used for displacment of the structures GRPICONDIR and GRPICONDIRENTRYĬall 'FastCRT.GetOpenFileEx' D$hwnd, OtherSaveFilter,, &MB_SYSTEMMODALĬall VMemFree D$OtherFilePtr | mov D$OtherFilePtr 0 | ExitP release the memory previously allocated inside GetOpenFileEx To read any icon (including the ones having multiple sizes), and generating the proper RT_GROUP_ICONS i did this: Otherwise, he can also delete or replace to newer ones, if needed. If the user wants to use the disassembled icons then is ok to he do it, since the contents/structures are kept intact. That´s why i´m trying to maintain the amount of icons and their internal data on the same way as they were compiled. So, when we dealing with old apps to be disassemble or even apps written in whatever compiler or style we can see weird things in what concerns the resources icons. The icons routine i´m using for the disassembler purposes (and not only the assembler/resource compiler ones). Of course, i can resize other types of files to create the icons, but for icons itself, iis not desirable to change their original format while the app is being disassembled. About resizing the icons, this is not desirable, because we need to know previously how many icons are there and also multiple icons can be used as a kind of icon library (.icl) ( I saw multiple icons created with different images and not necessarily with the same image resized). Yes, i´m testing old style icons, but didn´t tested your routine on them yet. Have you tried to load such an icon with GdiPlus? If this is the case, you could resize the image data by yourself? I presume ( could be wrong ) GdiPlus loads the first icon image. Quote from: Siekmanski on October 19, 2020, 06:31:14 PMĪre you pointing to old style Icons with the same image but different sizes in one? but you needed to create a hicon previously or simply loaded it as a image file ? I tried to load an icon with GdipLoadImageFromFile but it returned me the same error as yours. (But not so soon, because it will require a lot of time to built some decent resources editor)Ībout GdipCreateBitmapFromStream, ok. My goal is to create a more decent resource compiler mixing the tools existent in Bome Restorator, Reshacker, Resource Tuner and RosAsm´s Form Wizard. I can´t dedicate too much time on this editor right now, because i´m fixing several issues in RosAsm resources routines 1st. I did a iconeditor dll already, but it is only for 16 colors yet and it is still somewhat limited. So i can try to understand better how to properçly handle icons inside a executable (For RosAsm resource editor, i mean). I´m currently working on this example to give a test: I used to play with it a long time ago to create or edit icons, but now all i need is understand what are the standard sizes that windows can handle on icons inside a executable file (or a dll) and how to use gdiplus to manipulate it´s pixels, convert a bmp, png etc to icon (and vice-versa) and also keep the transparency and ability to handle the different formats inside the same icon (either a. So is there a limitation of the icon sizes and formats ? (i suppose, they always must remains squared, right ?)Īlso, using diplus it is said to we get the HIcon to create the proper transparent background when converting it to bitmap, as in:īut.how to create the proper hcion from an ".ico" file loaded ? And what will happens if the ".ico" file contains more then 1 icon format ? Can i use LoadImageA for this purpose or i can use gdiplus to an alternate way to load and convert this ?Īnd also.later, once this icon isseu ios fixed or created, can this be done on the same way with cursors or cursors works completely different ?Ĭall BmpDrawToDC eax, 'USER32.EndPaint' BmpDrawToDC:Ĭall 'GDI32.CreateCompatibleDC' | mov eaxĬall 'GDI32.SelectObject' 'User32.GetClientRect' 'GDI32.BitBlt' 0, 0, 0, 0, &SRCCOPYĬall 'GDI32.RestoreDC' 'GDI32.DeleteDC' Steve. I already suceeded to import images in many formats using gdi+ and also grabbing their pixel data, formats etc and export to webp, png, tiff, bmp etc using Marinus and JJ´s techniquesġ - Load an icon file (including icons that have more then 1 format/size)Ģ - Get their contents (pixeldata and also the transparency mask if existent)ģ - Show it on screen, and with it´s contents, place them on the proper Resources section to create the RT_ICON and related RT_GROUP_ICON structures.Ĥ - Export it back as icon (and whatever other formats as well)įrom M$ is said that icons have fixed sizes and bpps, so only allowing formats such as:īut.i already saw icons in formats such as 72x72.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |