Shoutbox

help getting handle of an element. - 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: help getting handle of an element. (/showthread.php?tid=64690)

help getting handle of an element. by Ash_ on 08-09-2006 at 11:06 AM

ok, basically i have an element

code:
            <Element xsi:type="ImageElement" Id="Avatar">
                <Position Top="1" Left="62"/>
                <Image><Name>avatar</Name></Image>
            </Element>


it has an image inside it, i wanna get the handle of it so i can use a GetDC() call on it (so i can write text on the image then save it and use as a DP). i found a GetControlHandle call im PlusWnd but i cant figure out how to get an image to load on a control (-dt- suggested using the Image control but i cant figure it out).

anyone got any advice on how i should go about writing text onto an image and saving it  (with the text on it still)?

thanks in advance
RE: help getting handle of an element. by RaceProUK on 08-09-2006 at 02:38 PM

Instead of using GetDC() (which implies GDI), try getting the data into a Bitmap object (which is in the far better GDI+).

Using the GDI+ API will allow you to render text easily, and quickly save the file in one of a number of formats.

Even if you have to get a DC, it should be possible to use a GetHandle-type call on the element with the ID of 'Avatar', and then copy the data from that DC to the Bitmap.

If you like, I'll post more information later when I've had a chance to fully research it.