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.

Newcomers DBPro Corner / enlarging an image

Author
Message
Chrissell
4
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 30th Jul 2016 17:44
Is it possible to enlarge an image file and paste it on the screen without affecting the rest of the screen. Im trying to grab the image and enlarge it as im making a paint program and i want to zoom in so i need to show an enlarged image next to the original image.

Thanks
Chris
C.R.Sellen
Derek Darkly
5
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 3rd Aug 2016 23:26 Edited at: 4th Aug 2016 23:40
Yes, this is possible! (You may want to direct future questions to the general DBPro discussion forum because less people check the Newcomers forum.)

Others may have a better solution but here's mine:

(1) Load your image using LOAD IMAGE (use the no-compression flag for full detail)
(or in the case of your paint program use GET IMAGE)
(2) Use the SPRITE command to make a sprite from your image number
(3) Use SIZE SPRITE or SCALE SPRITE to get your new size
(4) Use GET IMAGE to capture new image using the no compression flag

Again, others may know better, but I have used this method successfully,
Send your parents to noisy sprite demo hell... enter the D-Zone
Chrissell
4
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 5th Aug 2016 17:45
Thanks That does the trick. I find that the screen turns blue when I display the enlarged sprite. and I cant get the black drawing screen back? Thanks
Chris

rem *** move mouse ***
do
a=mouseclick()

rem *** draw pixel ***
if a=1 then x=mousex() : y=mousey(): dot x,y
if a=2 then x=mousex() :y=mousey()
if spacekey()=1 then wait 100: get image 1,0,0,300,300 : sprite 1,400,100,1 :scale sprite 1,200 : get image 2,400,100,600,200 : wait key : paste image 2,0,0
loop

wait key
end
C.R.Sellen
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 5th Aug 2016 22:20 Edited at: 5th Aug 2016 22:55
3D object turn the camera backdrop on when you load or create an object unless you use the statement Backdrop Off. Sprites are a little trickier, they will turn the backdrop on when the sprite gets rendered whether you have used Backdrop Off or not. Using the statement Set Sprite before the sprite gets rendered will prevent the camera backdrop from getting turned on. The parameters used for Set Sprite do not have any affect on this. you could also run the program with the backdrop on and set the camera backdrop color with - Color Backdrop. If you want black use Color Backdrop 0.

Edit: I should add, to prevent sprites from turning the camera backdrop on you only need to use Set Sprite on one sprite.
Derek Darkly
5
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 6th Aug 2016 03:16 Edited at: 6th Aug 2016 03:17
I was making a paint program a while back and shelved it.

This was my starting thread, it may give you some ideas for the actual painting part:
https://forum.thegamecreators.com/thread/212825

I've attached some brush samples that worked pretty well if you want them.
Send your parents to noisy sprite demo hell... enter the D-Zone

Attachments

Login to view attachments
Chrissell
4
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 6th Aug 2016 11:17
Thanks so much for your help. SET SPRITE works great just what i wanted and thanks for the Brushes love the airbrush effect.

Chris
C.R.Sellen
Derek Darkly
5
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 6th Aug 2016 18:12 Edited at: 6th Aug 2016 18:14
No problem!
Send your parents to noisy sprite demo hell... enter the D-Zone

Attachments

Login to view attachments
Phaelax
DBPro Master
14
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Agartha
Posted: 31st Aug 2016 10:28
You're probably too new to the forums to remember the DB challenges we used to do. But we did have a paint program challenge once. Here are the entries:

http://zimnox.com/dbcc/index.php?page=view&challenge=Paint%20Program&lang=pro

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Derek Darkly
5
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 1st Sep 2016 00:28

Quote: "But we did have a paint program challenge once. Here are the entries:"


I tried to compile yours, Phaelax, but you must be using some plugin command that I don't have.

By the way, being the slothful Yank that I am, I just now discovered the comedy show 'Little Britain' after seeing the movie 'Small Apartments' on Crackle.
Matt Lucas is absolutely hysterical!!! Takes me back to the Benny Hill/Monty Python days!!


Send your parents to noisy sprite demo hell... enter the D-Zone
Phaelax
DBPro Master
14
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Agartha
Posted: 3rd Sep 2016 03:22
Quote: "I tried to compile yours, Phaelax, but you must be using some plugin command that I don't have."

Shouldn't be. One of our rules was no plugins. The whole point was to create something that others could just copy and paste into plain old vanilla DBP, hence our no external media rules.

I took a quick look at it. All you gotta do is comment out #CONSTANT NULL = 0 at the top. It was conflicting with a reserved word. It was written 10 years ago.


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Chrissell
4
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 23rd Sep 2016 20:03
Thanks for the links to Paint programs Challenge some nice ideas. very cool.
C.R.Sellen

Login to post a reply

Server time is: 2017-06-29 01:31:19
Your offset time is: 2017-06-29 01:31:19