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.

DarkBASIC Discussion / Problem with Size Image Function

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 5th Apr 2009 22:39
Here's the function i'm using



This doesn't work right but it should. i don't know why. any help?

Is there a good way to size image with memblocks?

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Apr 2009 22:49
Are you sure you can just overwrite the image by creating a new one in its number? I added a few things to your function, let me know if it works...



TheComet

Peachy, and the Chaos of the Gems

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 5th Apr 2009 23:59
like that it doesn't show up with anything.... hmmm thats weird?

New Site! Check it out \/
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Apr 2009 04:03
I would keep the original image separate, scaling will distort it so its best to use the original in the function every time.
I'm pretty sure there's a scale image or bitmap command?

@Latch (if he happens to come by)
You made a function to rotate images a while ago, now I have a different pc (not new) I dont have it any more, could you direct me to it.
I'll do a search and edit this if I find it.

can't read?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Apr 2009 04:49
no scale bitmap or image. just sprite. thats the problem.
Get image doesn't capture sprites well somehow (i think it was u who made this function i found it in codebase) someone got it to

New Site! Check it out \/
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Apr 2009 21:25 Edited at: 7th Apr 2009 03:09
@Obese
Rotate Image

@Caleb
Like Obese wrote, if you are going to use a sprite from an image and such, it's best to keep the original separate. You can unintentionally corrupt the image when you are resizing it as a sprite and deleting/changing the image from the same sprite/image that the sprite/image was made from. If a sprite is made by a certain image, changing the image changes the sprite etc... It all has to do with timing.

A less corruptive method is to either use separate images for the source and result, or use a method of blitting a new image. Blitting an image is a block transfer of pixel information; you know it better as COPY BITMAP. By using the size parameters of copy bitmap, you can effectively scale your image (or any part of it) however you want.



Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Apr 2009 22:21 Edited at: 6th Apr 2009 22:24
oh! i didn't know that copy bitmap could stretch/shrink a image! thanks!

i'm not using sprites for the program i'm using images i was just trying to use sprites to scale the image

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 7th Apr 2009 01:35
@latch u need a sync right b4 the wait key, it didnt show the big image, heres ur code fixed:



There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Apr 2009 02:00
Good lookin' out!

Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 03:03
Thanks i was just about to run that and i didn't notice haha

New Site! Check it out \/

Login to post a reply

Server time is: 2025-08-08 20:42:27
Your offset time is: 2025-08-08 20:42:27