Jump to content


Photo

Impclipboard


  • Please log in to reply
20 replies to this topic

#1 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 19 April 2009 - 08:09 AM

Okay, some of you may remember my last attempt at a clipboard DLL. It was able to copy images and files, but it couldn't paste anything...which made it essentially useless. The closest I got to pasting images worked 50% of the time, and the other 50% it crashed the game.

Well, I'm here with great news! I randomly decided to try again, and with the help of Google (which seems to have updated its index since last I tried this) I've gotten it working 100%!

What can the IMPClipboard DLL do? Directly from the example's info:

This DLL allows you to copy and paste images (as BMPs, sprites, and backgrounds), as well as copying files and retrieving the filenames of any files on the clipboard. Finally, GM can copy and paste more than text!

FUNCTIONS

Here is a list of all functions and what they do. Read the script comments for arguments, syntax, return information, error codes, and extra notes.

IC_Init() - Call to initialize IMPClipboard. Call it once--and only once--before using any IMPClipboard functions.

IC_CopyImageFile() - Call to copy a given Bitmap file to the clipboard.

IC_CopySprite() - Call to copy a sprite to the clipboard.

IC_CopySpritePart() - Call to copy a given part of a sprite to the clipboard.

IC_CopyScreen() - Call to copy a screenshot of the GM window to the clipboard.

IC_CopyScreenPart() - Call to copy part of a screenshot of the GM window to the clipboard.

IC_CopyBackground() - Call to copy a background to the clipboard.

IC_CopyBackgroundPart() - Call to copy part of a background to the clipboard.

IC_CopyImage() - Call to copy an image file, in any type GM supports, to the clipboard.

IC_PasteImage() - Call to paste an image from the clipboard to a file.

IC_Paste_Sprite() - Call to create a sprite from the image on the clipboard.

IC_Paste_Background() - Call to create a background from the image on the clipboard.

IC_CopyFiles() - Call to copy a file or a ds_list of files to the clipoboard.

IC_GetNumberFiles() - Returns the number of files on the clipboard's file list, if any.

IC_GetFileName() - Returns the name of the specified file on the clipboard's file list, if any.

IC_Free() - Call to cleanup the DLL and any memory it uses.


Amazing, no? The download ZIP comes with the .gml file for you to import into your own games, the .DLL (of course), and an example .GMK to demonstrate the DLL's functionality.

Again, from the example's info:

USING THE EXAMPLE

This example focuses on demonstrating the functionality of the DLL more than UI. Plus, I'm finishing this up at 3:30AM, so I'm trying to make this quick. Read below to learn how to use the example.

COPYING IMAGES: Click and drag anywhere to select part of the screen. Then press CTRL+C to copy that part of the screen to the clipboard. Press S to toggle the displayed shape between a circle and a square. Press SPACE to choose the color of the inner circle or top of the square.

PASTING IMAGES: Press CTRL+V to paste whatever image is on the clipboard (even from another program!) into a sprite. The example will then assign that sprite to an instance so you can see it.

COPYING FILES: Press CTRL+F to add a new file to the list of files to be copied. The title bar shows the number of files on the list. When you're done, press ENTER to copy all the chosen files to the clipboard. Press CTRL+L to get a list of all the files on the clipboard (even if they were copied elsewhere!)


All functions have been tested, but there's always a chance I've missed some things (especially given the current time and my rushed state), so if you find any bugs, please let me know about them.

I'd suggest having MSPaint open while you play with the example; it really lets you see how the copying/pasting between programs can be useful. Also, when testing the file copying/pasting, just open any old folder and use that to test (i.e. copy files from there and get the list in-game, or copy files in-game and paste them into that folder normally).

Important Note: Copying images works only with GM7 and below. All other functions (copying/pasting files and pasting images) work with all versions of GM.

Here's the download link:
http://icemetalpunk....MPClipboard.zip
New Link(Working as of 9/12/10)

mirror link on mediafire

Please leave comments, positive and negative.

-IMP ;) biggrin.gif

*EDIT* Fixed a slight bug in the example dealing with the drawing of the crop box. Unimportant to the DLL's functionality, but I fixed it anyway biggrin.gif .


Edited by chance, 02 March 2015 - 04:23 PM.

  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#2 Hockeyflyers

Hockeyflyers

    Hockeyplayer Games

  • New Member
  • 1108 posts
  • Version:Unknown

Posted 19 April 2009 - 03:08 PM

Could this support transparencies? Like if you copied a transparent .png image, pasted it into a .png file, and imported it into GM with petersvp's .png dll?

Anyways, great DLL! First released on the gmc that copies and pastes images, right?

Edited by Hockeyflyers, 19 April 2009 - 03:09 PM.

  • 0

#3 PickleMan

PickleMan

    Programmer

  • New Member
  • 995 posts
  • Version:Unknown

Posted 19 April 2009 - 03:50 PM

You beat me to it...
Nice DLL anyway
  • 0

#4 chaz13

chaz13

    GMC Member

  • GMC Member
  • 4214 posts
  • Version:Unknown

Posted 19 April 2009 - 05:48 PM

This is very, very useful! great job!
  • 0

#5 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 20 April 2009 - 12:40 AM

@HockeyFlyers: As far as I know, there's no native support for transparent images on the clipboard. The best way I can figure to do this is using private formats, but I am way too inexperienced for that. Sorry.

And, yes, this is the first (and for now, only) DLL that can copy/paste images, and also the first that can copy/paste files.

@PickleMan: Thanks. I didn't know you were working on one ;) .

@chaz: Thanks :P .

BTW, no credit is required when using this DLL, though it would be nice...

-IMP ;) :(
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#6 Skarik

Skarik

    GMC member

  • GMC Member
  • 1068 posts
  • Version:GM:Studio

Posted 20 April 2009 - 01:10 AM

Wow. Sex. And the day I decide to start too.

Dang.


Sweet, now I can make a game that literally goes out of the window! :P

Thanks bunch!

(It's a pain in the butt, though, that I have to convert the damn thing back to a GM6 file). Wait, no, there's a GML file! Once again, you rock!
  • 0

#7 PickleMan

PickleMan

    Programmer

  • New Member
  • 995 posts
  • Version:Unknown

Posted 20 April 2009 - 01:25 AM

Yes, I was working on one, but I hit the same pitfalls that you did.
  • 0

#8 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 20 April 2009 - 03:32 AM

@Skarik: Ummm...thanks? I'm not sure how this will help you make a game that goes out of the window, but I guess I'll find out eventually ;) .

@PickleMan: Yeah, it's the weirdest thing. I hadn't touched it in months (since the aforementioned crashing), and as I'm looking through the Creations "Tools" subforum, I thought, "What kind of quick tools can I make?" My second GM creation ever was a multi-copier that stored up to 9 text slots for copying later, so I thought of that. I wondered what I could do to update that, and I thought: Darn it! Images! So I Googled and Googled and then suddenly, it all came together.

Oh, and I'm definitely using this in my IGFX (or .ACA, or whatever the extension is now) editor ;) .

-IMP :( :P
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#9 PickleMan

PickleMan

    Programmer

  • New Member
  • 995 posts
  • Version:Unknown

Posted 20 April 2009 - 03:53 AM

Ok. BTW, can I help with the editor?
  • 0

#10 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 20 April 2009 - 04:50 AM

Sure. I just began work on it, but it's 12:30 AM. Plus, this is off-topic, so please PM me so I'll get the PM tomorrow and remember ;) .

-IMP :( :P
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#11 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 21 November 2009 - 04:20 PM

I know I'm bumping a seven-month-old topic, and I apologize for that, but I think this is important enough.

Due to WillHostForFood's untimely demise, I've updated the link. It should now be accessible to anyone who's had trouble downloading this DLL in the past.

-IMP :P :whistle:
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#12 krele

krele

    GMC Member

  • GMC Member
  • 640 posts
  • Version:GM:Studio

Posted 23 May 2010 - 08:43 PM

I know I'm bumping a seven-month-old topic, and I apologize for that, but I think this is important enough.

Due to WillHostForFood's untimely demise, I've updated the link. It should now be accessible to anyone who's had trouble downloading this DLL in the past.

-IMP :) :)

Orly?
  • 0

If I helped you, you can help me back :3

Brocoola


#13 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 26 May 2010 - 07:07 AM

I know I'm bumping a seven-month-old topic, and I apologize for that, but I think this is important enough.

Due to WillHostForFood's untimely demise, I've updated the link. It should now be accessible to anyone who's had trouble downloading this DLL in the past.

-IMP :GM122: :)

Orly?

Ummm.... yesrly. It works for me, still. Does it not work for you?

-IMP :GM031: :)

*EDIT* Oh, by the way... I should mention that any of the resource-copying functions, as well as the CopyImage function, will not work in GM8. The CopyImageFile() function and all the pasting functions, as well as all the file functions, should work just fine.

The reason is because of GM8's transition to PNG-based images instead of BMP-based. That's caused a bit of an issue with the DLL, which loads/saves as BMP only. Although I don't plan on fixing this, if I ever get bored and find a way to save/load PNGs, I'll update this for use with GM8. Until then... well, I suppose this DLL's only useful for GM7 and below.

Edited by IceMetalPunk, 26 May 2010 - 07:12 AM.

  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#14 iloveportalz0r

iloveportalz0r

    GMC Member

  • New Member
  • 25 posts

Posted 12 September 2010 - 09:47 AM

The link doesn't work :angry:
"Firefox can't find the server at icemetalpunk.110mb.com."
  • 0
I use Posted Image Pro version.
98% of the teenage population has smoked, if you are one of the proud 2% that never will, put this in your sig.
How good are you at GML?
Posted Image

#15 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 13 September 2010 - 04:02 AM

It's been 3 months...

Anyway, here's another mirror: http://www.upurload....1e8bbc39d84.zip

I think I've found a way to make it PNG compatible (and thus GM8 compatible), but Dev-C++ is malfunctioning for me now, so it may be a while before I even get a chance to work on that.

-IMP ;) :)
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#16 Qon

Qon

    GMC Member

  • GMC Member
  • 85 posts

Posted 21 March 2011 - 03:25 PM

Very nice, but it has bugs for me:
The Qtrl+C funcion works only once, or sometimes not at all. Resarting the program and now it doesn't work at all (Qtrl+C, prntscr -> Qtrl+V still works)


I might use this for a program that copies the screen and uses it as background :)
  • 0

#17 SSSSSSS153

SSSSSSS153

    GMC Member

  • New Member
  • 69 posts

Posted 16 April 2011 - 08:14 AM

I have a bug in the example. If you select an area from bottom-right to top-left rather than the other way around, it always fails at copying. But it works fine the other way.

EDIT: Turns out the problem wasn't the copying, it was the example. Just making it check switch round the xx/ox and yy/oy if they need to makes it work. I just used this code in the global left released:

if xx < ox {
    temp = xx;
    xx = ox;
    ox = temp;
}

if yy < oy {
    temp = yy;
    yy = oy;
    oy = temp;
}

Edited by SSSSSSS153, 16 April 2011 - 08:19 AM.

  • 0
Posted ImagePosted Image
Posted ImagePosted Image

#18 deluksic

deluksic

    GMC Member

  • GMC Member
  • 54 posts
  • Version:GM8

Posted 23 June 2011 - 11:32 AM

Somebody please answer! I tried to press print screen button and paste it into the game... all i get are few windows that are open, icons and taskbar.. no background and few parts of open windows are missing... they are totaly transparent.. wtf?

EDIT: im using GM 8... is there any way it works with gm 8?

Edited by deluksic, 23 June 2011 - 12:21 PM.

  • 0

#19 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 08 July 2011 - 03:28 PM

Somebody please answer! I tried to press print screen button and paste it into the game... all i get are few windows that are open, icons and taskbar.. no background and few parts of open windows are missing... they are totaly transparent.. wtf?

EDIT: im using GM 8... is there any way it works with gm 8?

No, it doesn't. I was never able to get PNG support for it, so it's only compatible with GM7 and below, which saves its images as BMP.

-IMP ;) :)

*EDIT* Update: I've tried getting GM8 support by using uuf6429's Image Conversion DLL (found here) to convert GM's PNG output to BMP for my DLL. It works half the time, and the other half seems to just fail. No errors or crashes, it just returns false and copies corrupt data. It seems completely random, too...but it works half the time, which is better than never! :P

Edited by IceMetalPunk, 10 July 2011 - 09:48 AM.

  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#20 master123

master123

    GMC Member

  • GMC Member
  • 68 posts
  • Version:GM8

Posted 26 October 2014 - 07:18 AM

Is there any possibility to get this DLL?

 

Thanks


  • 0

#21 Razon

Razon

    GMC Member

  • GMC Member
  • 268 posts
  • Version:GM:Studio

Posted 03 November 2014 - 06:45 AM

Here's a mirror link for the DLL.

 

http://www.mediafire...q4e4k5hd8ztcdkp


  • 1