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 / 'Line' and 'get image' not woring

Author
Message
randi
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 1st Oct 2002 01:06
Yes, I am pretty sure that this has been mentioned, but I am doing it again anyway.
I am trying to write a teaching program for Anatomy and I have run into problems that have ground me to a hault.

The line command color does not work. 'ink' has no effect on it what so ever.
Let me explain what does...
If I load an image, of a heart with a white background, the line command makes a white line.
If I load an image, of a heart with a black background, the line command makes a black line.
And so on with any other color as the bakground.
If I load an image with a white back ground, and then load another image that is 1 pixel by 1 pixel of black...
Guess what the line color is?
It is black!
This strange fix got it to do what I wanted, but then I just found a bug with the 'get image' command.
Once I had placed a line; I was trying to get the whole image of the screen, so I could place another line and refresh the screen.
When I pasted the image back, the image was all wrong and out of shape.
I did all this in DB classic and it works just fine.

What I am doing is...
Making a program so I can generate each lesson and then save them to be used in another program.
So the lines I am talking about are ones that get drawn with the mouse, just like any drawing program.
This means I have to update the screen, and I have to do this by getting the screen image, drawing the line, then pasteing the image over and over.
Does this all make sense???
Maybe not... but the line command and the get image are messed up.
And I have had to go back to DB classic until this gets fixed.

Randi
randi
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 1st Oct 2002 01:18
Yes... that's right...
Line and get image is not WORING.
They are also not WORKING.
Super Teo
21
Years of Service
User Offline
Joined: 18th Sep 2002
Location: Sweden
Posted: 1st Oct 2002 02:01
I have no problem with Get image thou, but I have experienced the line problem
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 1st Oct 2002 02:09
Yeah I'm getting the same problem with the line command. It seems to be picking up the colour or texture of my matrix.
randi
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 1st Oct 2002 03:00
I haven't had a problem with the 'get image' command when I am getting a piece from a loaded bitmap and using it to texture an object. The only problem is when I get the image from the screen and then paste it.
It looks as if the image is getting squared off.
Meaning all four sides are equal.
Like 480x480, not 640x480 which it should be.
I really don't know what the bug is, but my code works just fine in DB classic.
So it's obviously some bug in DBpro.

Randi
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 1st Oct 2002 03:19
This is the "power of 2" bug that has been discussed in length in another thread here. Essentially make sure when you "get image" (or even load image) that the image dimensions are powers of 2 along both X and Y axis. For example 16x16 or 64x2 or 128x32.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
randi
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 2nd Oct 2002 03:58
The image I am getting is the screen itself.
The command is 'get image 1,0,0,640,480'.

What is not a power of 2 with 640x480?
Should it be 'get image 1,0,0,639,479'?

Try making a simple line drawing program and you will see.

Randi
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 2nd Oct 2002 15:40
Err neither 640 or 480 are a power of 2 - try dividing them by 2 and continue doing so, eventually you'll hit 7.5 for 480 (and 3.5 for 640 I believe).

(Powers of 2: 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512 etc)

Very annoying and a stupid bug I agree - but my answer was still correct, sorry

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
randi
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 2nd Oct 2002 20:35
Ahhh! Gotcha!
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 2nd Oct 2002 21:38
At least Rich has admitted it's a bug and not a feature (I worked with a lot of companies that claim bugs are features so don't need fixing) so it should get fixed.

As for the line problem, I've reported it with example code to the DBS team (back when I was in the DBDN) so I hope that gets fixed in the next patch as well.

Super Teo
21
Years of Service
User Offline
Joined: 18th Sep 2002
Location: Sweden
Posted: 2nd Oct 2002 23:22
Wooha, I found another bug with the get image command! When I used it more than.. err must have been 24 times or so my program would just crasch and report a error and asked if I want to send it to microsoft...
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 2nd Oct 2002 23:39
Hmm I don't think that's a "get image" thing (I have code here that grabs an entire font set out of a BMP which is more than 24 times! and it doesn't fail). Maybe it's performing an illegal grab that isn't being checked properly. As with all things this is just experienced speculation until I see some code and media to assume otherwise.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Super Teo
21
Years of Service
User Offline
Joined: 18th Sep 2002
Location: Sweden
Posted: 3rd Oct 2002 22:23
Well thats the thing.. I know they are right because if I remove 1 get image earlier then the one that didnt work works again and the next get image command it crashes again...

Login to post a reply

Server time is: 2024-05-06 21:56:35
Your offset time is: 2024-05-06 21:56:35