What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » function to resize a picture

Pages: (2): « First [ 1 ] 2 » Last »
function to resize a picture
Author: Message:
Guena
Full Member
***

Avatar

Posts: 102
Reputation: 5
44 / Male / Flag
Joined: Nov 2008
O.P. function to resize a picture
Hi,


I need a function to resize a picture
Could someone please help me?

Thanks

Guéna
12-12-2008 10:46 AM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: function to resize a picture
How knowledgable are you with scripting? You are wanting to look at Gdip and GdipGetImageThumbnail which will allow you to resize the image in memory to be saved.

Try out some code because for us to just give you the code you will never learn.

Here are a good chunk of the functions you will need to complete such a task (in no particular order):

  • GdiplusStartup
  • GdiplusShutdown
  • GdipLoadImageFromFile
  • GdipCreateBitmapFromHBITMAP
  • GdipGetImageThumbnail
  • GdipCreateHBITMAPFromBitmap
  • CLSIDFromString
  • CLSIDFromString
  • GdipSaveImageToFile
  • DeleteObject

Best of luck!
12-12-2008 01:57 PM
Profile E-Mail PM Find Quote Report
Guena
Full Member
***

Avatar

Posts: 102
Reputation: 5
44 / Male / Flag
Joined: Nov 2008
O.P. RE: function to resize a picture
Thank you very much. I beggin in scripting.

I'm working on a Skin and a Script which work together.
The script allow anybody to add his own picture to backgrounds available in my Skin.

You can see the evolution of my work here.

I need to resize the picture to automatically add a thumbnail to the option panel of the Skin.

This post was edited on 12-12-2008 at 04:31 PM by Guena.
12-12-2008 04:30 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: function to resize a picture
Well give it a try I have all the code that will do it already written but I recommend you try it out see if you can get it because you will learn that way and we can show you were you are going wrong.
12-12-2008 05:09 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: function to resize a picture
DId you mange to get it working?
12-15-2008 02:01 PM
Profile E-Mail PM Find Quote Report
Guena
Full Member
***

Avatar

Posts: 102
Reputation: 5
44 / Male / Flag
Joined: Nov 2008
O.P. RE: function to resize a picture
Not yet, I'm learning how each function you gave me work
12-15-2008 02:25 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: function to resize a picture
Well once you have something post it and we will help you from there. Are you resizing an image that exists on the file system or are you capturing a screenshot and resizing it?
12-15-2008 03:38 PM
Profile E-Mail PM Find Quote Report
Guena
Full Member
***

Avatar

Posts: 102
Reputation: 5
44 / Male / Flag
Joined: Nov 2008
O.P. RE: function to resize a picture
I'm resizing an image that exists on the file system.
12-15-2008 05:09 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: function to resize a picture
This is how you initialize Gdi+ I will give you that much for now:

jscript code:
var GdipToken = Interop.Allocate(4);
var GdipStartupInput = Interop.Allocate(16)
    GdipStartupInput.WriteDWORD(0, 1);

// will return True if successful false if it failed
function Gdip_Initialize () {
    return Interop.Call('gdiplus.dll', 'GdiplusStartup', GdipToken, GdipStartupInput, 0) === 0;
}

function Gdip_Uninitialize() {
    Interop.Call('gdiplus.dll', 'GdiplusShutdown', GdipToken.ReadDWORD(0));
}
12-15-2008 05:32 PM
Profile E-Mail PM Find Quote Report
Guena
Full Member
***

Avatar

Posts: 102
Reputation: 5
44 / Male / Flag
Joined: Nov 2008
O.P. RE: function to resize a picture
Thank you very much.
I'm Waiting for a compatible version of MP!L with the WLM 9 RC to go on.
12-18-2008 01:09 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On