Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Free Image Joiner / Cropper (made in DBPro) with code

Author
Message
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 13:01 Edited at: 27th Oct 2011 00:49
I just fudged a utility for someone else on the forum here and thought I'd share.

Latest Download 26th Oct 2011
EDIT: It also autocrops the images keeping a consistent centre.

You put your images in the "Images" folder, start the application, set up the crop size (power of 2) and then hit enter and it makes a sprite sheet for you in the "Output" folder.

It's basic but as long as you number or alphabetically order your images it will produce a simple spritesheet.

If you want to compile it you'll need the Image Kit V2, Cloggy's D3D and Matrix Utility plugins.

Hope it helps!

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 14:46
OK I've updated it to autocrop the images for you too now...

It will autocrop transparent images up to the minimum size in order to keep a centre position for the images.

You're more than welcome

Download!

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 20th Oct 2011 17:08 Edited at: 20th Oct 2011 17:09
great tool!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Oct 2011 15:44
Fixed a bug where it seemed to not be clearing the images as it went: Updated download! 21st Oct 2011

Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 22nd Oct 2011 21:02
Do you know how to set needed size of saving image?

It's not suitable for my needs to have 64,128,256,512...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 21:52
Quote: "Do you know how to set needed size of saving image?"

Yes I do The code could be edited for different image sizes.

I guess it depends on what your needs are, but the code is all there.

Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 22nd Oct 2011 22:15 Edited at: 22nd Oct 2011 22:22
I need something like Image Joiner(in AGK) but in right sequence to use it for GDK.
If you know how to make it, can you just tell me how?

First: I draw the Image into Bitmap
Second: I get the new Image from Bitmap
Third: I save the new Image

*but I found that Bitmap size can be only x8 (32,64,128,256,512,1024...)
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 22:38
Quote: "I need something like Image Joiner(in AGK) but in right sequence to use it for GDK."

What do you mean by the right sequence?

Quote: "If you know how to make it, can you just tell me how?"

I'll help if I can but I don't fully understand what you are looking for.

If you paste an image or sprite in DBP you are effectively pasting it to Bitmap number "0"

If you then use the command "make memblock from bitmap" then "make image from memblock" then "save image" you might get the result you are after but you aren't being clear enough for me to be sure...

Bitmap sizes can be specified in DBP at any width and height your graphics card can handle (I think)...

Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 22nd Oct 2011 23:07
It's just GDK - has a same commands as DarkBasic

dbLoadImage("somename.png",1);
dbCreateBitmap(2,ANYSIZE,ANYSIZE);
dbSetCurrentBitmap(2);

dbGetImage(2,0,0,ImageSizeW,ImagaSizeH);
dbSaveImage("test.png",2);

*Look attached files

Attachments

Login to view attachments
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 22nd Oct 2011 23:21
You're genius!!! Mistake was in GetImage!!! MEMBLOCKS - RULES!!!

THANKS A LOT!!!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd Oct 2011 00:08
Great, glad to help

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Oct 2011 00:48
This version has fixed the overlapping image bug: Latest Download

Login to post a reply

Server time is: 2024-04-25 14:11:44
Your offset time is: 2024-04-25 14:11:44