[?] CustomLook Images & Resize - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: [?] CustomLook Images & Resize (/showthread.php?tid=82412) [?] CustomLook Images & Resize by Spunky on 03-16-2008 at 08:38 PM Is there anyway to change an image element inside a Button's CustomLook because the normal method doesn't seem to work. Once I get it to change, I also need to make the image stretch to the size of the button. Is there something I can add in the XML to do this? RE: [?] CustomLook Images & Resize by mynetx on 03-16-2008 at 08:43 PM As for the size, you can always give an absolute image size, and add <Mosaic>ResizeToFit</Mosaic> to it. As for on-the-fly change, this is currently not supported by PlusWnd::ImgElmt_SetImageFile(). Either this cannot be done, or you need to use a Windows API call to achieve the result; I'm not sure about the last one. RE: [?] CustomLook Images & Resize by Spunky on 03-16-2008 at 08:46 PM
I was hoping for an API tbh. RE: [?] CustomLook Images & Resize by markee on 03-16-2008 at 11:42 PM
I think you might need to look at usig some GDI+ stuff. Mattike used some in Log Manager, and I borrowed some of the code for Web2Live. I think matty also used it in one of his scripts (Screenshot Sender 4?). You'll also need to look up trusty MSDN for the exact stuff on the button. RE: [?] CustomLook Images & Resize by Patchou on 03-17-2008 at 07:21 AM
what isn't supported? RE: [?] CustomLook Images & Resize by Matti on 03-17-2008 at 05:08 PM
quote:From my understanding, he wants to change the image of an ImageElement in a ButtonControl's custom look in runtime. quote:I highly doubt that GDI/GDI+ will help you here. In Log Manager and the upcoming Countdown Live 2, I use GDI/GDI+ to make a HBITMAP from a GIF/PNG/... file and pass that to a Win32 API which handles the drawing itself. When you want to use GDI/GDI+ to draw the button yourself, you'd have to register the owner-draw notification and do the drawing on the parent window yourself. As far as I know, this is a very difficult way to do it and I don't think Plus! even supports it. And in my opinion, there shouldn't be any reason why Plus! should support it. quote:Nope, I stole his code to initialize and quit GDI+ and based my stuff on his. He's the one who does magic with GDI and GDI+. My suggestion: Patchou should give us some control over the CustomLook elements of buttons / radio buttons / check box buttons. The image resizing should then be handled the way it's handled when the window is generated from the interface XML. |