Shoutbox

[?] 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.

I'm basically making an image that resizes with the window if that helps anybody out. It's inside a button else it wouldn't have a handle and I can't resize it


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.

Have fun trying to work this out.... :tongue:


RE: [?] CustomLook Images & Resize by Patchou on 03-17-2008 at 07:21 AM

what isn't supported?

I need to understand more clearly what you want to do. From my understanding, all you need is a custom look button with a picture element in it with a size declared as being dynamic if the button's size changes when the window is resized. If that does not answer your particular problem, pleaes give more information and I'll tell you if it is, indeed, supported or not :).


RE: [?] CustomLook Images & Resize by Matti on 03-17-2008 at 05:08 PM

quote:
Originally posted by Patchou
what isn't supported?

I need to understand more clearly what you want to do. From my understanding, all you need is a custom look button with a picture element in it with a size declared as being dynamic if the button's size changes when the window is resized. If that does not answer your particular problem, pleaes give more information and I'll tell you if it is, indeed, supported or not :).
From my understanding, he wants to change the image of an ImageElement in a ButtonControl's custom look in runtime.
quote:
Originally posted by markee
I think you might need to look at usig some GDI+ stuff.
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:
Originally posted by markee
I think matty also used it in one of his scripts (Screenshot Sender 4?).
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.