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 Professional Discussion / How can I get the image from a drawn line on the screen ?

Author
Message
dman
21
Years of Service
User Offline
Joined: 21st Feb 2005
Location:
Posted: 15th Feb 2011 18:43
I want to know how to get an image without drawing it on the screen first. Is there a way to draw directly to an image?

I drew the line first then use the "get image" then display the image on the screen, this is not what I need.

please help.
Teh Stone
16
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 15th Feb 2011 19:05
i dont know if theres a way of directly drawing to an image but you can use seperate bitmaps

create a new bitmap
draw the line
get image
set current bitmap back to thew original
draw what you "Get imaged"



Hope this helps


no promises on speed there btw
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Feb 2011 19:05
CREATE BITMAP will do just what it says. By creating it, it will become the default bitmap, and all activity (drawing lines, placing sprites etc) will be directed here. Then, you can GET IMAGE and finally DELETE BITMAP.

If you get more complex, you may also have to consider SET CURRENT BITMAP. But the default behaviour should suffice for most scenarios.

dman
21
Years of Service
User Offline
Joined: 21st Feb 2005
Location:
Posted: 15th Feb 2011 19:14
so does this mean that I can draw on "set bitmap 1" while I display on "set bitmap 0" at the same time ?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Feb 2011 19:20
You would do your drawing on the bitmap in between SYNCs, delete that bitmap and paste the result somewhere on the screen before the sync. Or as BatVink said, create the bitmap at the beginning of the program. Then switch to it when you need to draw something and get it, then switch back to bitmap 0, which is the default screen.

Also, if you are planning on the image you get having any Alpha value for transparency then be sure to use this command at the beginning of your program.

SET BITMAP FORMAT 21

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Feb 2011 19:21
Yes, you can create a bitmap, which is then like a hidden image, draw on it, paste images, lines etc, then grab your image and switch back to bitmap 0...



Health, Ammo, and bacon and eggs!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Feb 2011 19:28
The imagekit plugin also allows you to draw on non visible images.

My signature is NOT a moderator plaything! Stop changing it!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Feb 2011 20:41
@dman,
I've removed your avatar - 1.5MB is far too large.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Feb 2011 23:18
memblocks

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein

Login to post a reply

Server time is: 2026-07-16 01:44:28
Your offset time is: 2026-07-16 01:44:28