drawpic issues?
Author |
Message |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Sat Apr 28, 2012 11:42 pm Post subject: drawpic issues? |
|
|
I cant get drawpic to work, in turing 4.1.2, turing crashes when useing drawpic, when used in 4.1.1-4.1 turing reports a segment violation and it works in 4.0.5 anyone know why? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Amarylis
|
Posted: Sun Apr 29, 2012 1:04 am Post subject: RE:drawpic issues? |
|
|
I'm not too familiar on the newer versions of Turing that were official releases from Holtsoft (I personally didn't go any further than 4.1, since the stand-alone executable compiler didn't function on 4.1), but I suggest that you take a look into [url="http://compsci.ca/v3/viewtopic.php?t=29759"]this[/url]. It's an Open Source version of Turing.
If you are bent in staying on 4.1.2 though, could you please give some more info as to what happened with the crash? |
|
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Sun Apr 29, 2012 7:53 am Post subject: RE:drawpic issues? |
|
|
not helpful at all, open turing uses the source code from 4.1 which as I said doesnt allow you to use drawpic because turing reports segment violation. + open turing is super buggy, and the person working on it has stopped updating. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Apr 29, 2012 9:30 am Post subject: RE:drawpic issues? |
|
|
is the issue the same for drawing pictures of different file formats and different sizes? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Sun Apr 29, 2012 11:38 am Post subject: Re: drawpic issues? |
|
|
I'm using this example posted on compsci. I ran it at school with 4.0.5 then emailed it home, but it wouldnt work at home.
Turing: | View.Set ("graphics:640;480,nobuttonbar,offscreenonly")
const scale := 0. 25
const x := round (maxx * scale )
const y := round (maxy * scale )
var b : array 1 .. sizepic (1, 1, x, y ) of int
takepic (1, 1, x, y, b )
b (7) := 48
for i : 19 .. upper (b )
b (i ) := 0
end for
var id := 19
var n := 0
var t := Time.Elapsed
for j : 1 .. y
for i : 1 .. x
b (id )| = 255 * i * j div (x * y ) shl n %b
if n < 24 then
n + = 8
else
n := 0
id + = 1
end if
b (id )| = 255 * i * j div (x * y ) shl n %g
if n < 24 then
n + = 8
else
n := 0
id + = 1
end if
b (id )| = 255 * i * j div (x * y ) shl n %r
if n < 24 then
n + = 8
else
n := 0
id + = 1
end if
end for
if n > 0 then
id + = 1
n := 0
end if
end for
drawpic (0, 0, b, 1)
var p := Pic.New (1, 1, x, y )
Pic.Draw (Pic.Scale (p, maxx, maxy), 1, 1, picCopy)
put "Draw Time: ", Time.Elapsed - t, " Milliseconds" |
|
|
|
|
|
![](images/spacer.gif) |
tiedye1
![](http://compsci.ca/v3/uploads/user_avatars/197771568354ed6b69b6f2f.png)
|
Posted: Sun Apr 29, 2012 2:45 pm Post subject: RE:drawpic issues? |
|
|
The procedures, takepic, drawpic, and sizepic are considered obsolete. You should use the Pic module for the whole thing. |
|
|
|
|
![](images/spacer.gif) |
Amarylis
|
Posted: Sun Apr 29, 2012 3:04 pm Post subject: Re: drawpic issues? |
|
|
copthesaint @ Sun Apr 29, 2012 11:38 am wrote: I'm using this example posted on compsci. I ran it at school with 4.0.5 then emailed it home, but it wouldnt work at home.
Turing: | View.Set ("graphics:640;480,nobuttonbar,offscreenonly")
const scale := 0. 25
const x := round (maxx * scale )
const y := round (maxy * scale )
var b : array 1 .. sizepic (1, 1, x, y ) of int
takepic (1, 1, x, y, b )
b (7) := 48
for i : 19 .. upper (b )
b (i ) := 0
end for
var id := 19
var n := 0
var t := Time.Elapsed
for j : 1 .. y
for i : 1 .. x
b (id )| = 255 * i * j div (x * y ) shl n %b
if n < 24 then
n + = 8
else
n := 0
id + = 1
end if
b (id )| = 255 * i * j div (x * y ) shl n %g
if n < 24 then
n + = 8
else
n := 0
id + = 1
end if
b (id )| = 255 * i * j div (x * y ) shl n %r
if n < 24 then
n + = 8
else
n := 0
id + = 1
end if
end for
if n > 0 then
id + = 1
n := 0
end if
end for
drawpic (0, 0, b, 1)
var p := Pic.New (1, 1, x, y )
Pic.Draw (Pic.Scale (p, maxx, maxy), 1, 1, picCopy)
put "Draw Time: ", Time.Elapsed - t, " Milliseconds" |
Ran all that in my version of Open Turing, worked just fine O.o |
|
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Sun Apr 29, 2012 6:27 pm Post subject: RE:drawpic issues? |
|
|
-_- @ Amarylis I am still not using Open turing until a stable release has been verified.
...@ tiedye1 It is not obsolete. If you would look at the example for one minute maybe you would understand why I want to use it.
@ tony, do you know of a different way I could draw the the pixels from the buffer created by the base 2 value for Red Green and blue? I dont want to set each individual color for the pixels though. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
tiedye1
![](http://compsci.ca/v3/uploads/user_avatars/197771568354ed6b69b6f2f.png)
|
Posted: Sun Apr 29, 2012 9:46 pm Post subject: Re: drawpic issues? |
|
|
Sorry, I should have looked though the whole thing. I didn't relize what you were trying to do. But, Holtsoft does say that those methods are obsolete and did screw them up in Turing 4.1. Its mentioned here http://compsci.ca/v3/viewtopic.php?t=11555. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Mon Apr 30, 2012 1:35 am Post subject: RE:drawpic issues? |
|
|
I was thinking of Draw.Pic...
still, the same kind of questions should start off the investigation of what is happening -- how does the code behave with different sizes of the buffer (e.g. smaller values of x/y)? What about just redrawing the buffer as is, without modifying any of its values? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Mon Apr 30, 2012 7:05 am Post subject: RE:drawpic issues? |
|
|
Draw.Pic is not a function,
The procedure drawpic crashed the program regardless of the buffer size.
And if I could Just redraw the buffer, I would, however it would require a shitload of processing time by setting the rgb color for each pixel that is drawn which is pointless because the reason why im doing this is so I specifically DONT have to set the RGB value and save alot of speed.
Essentially by drawing the picture with picdraw, I can accomplish things like inverting the colors,
scaling, adding brightness, ect to computer generated images and still have a decent rate of fps. Not only that cut the whole Draw module could be redone with drawpic acting as the buffer for the screen and just sending info to the picture directly at 24bit color.
Thats the reason I want to use drawpic.
I want to see how effective it would be to create a new draw module using picdraw. |
|
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Tue May 01, 2012 5:38 pm Post subject: RE:drawpic issues? |
|
|
Alright, So the first issue of it crashing was actually caused by my stupid firewall, I have the example working at home on 4.0.5 So thats good enough. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Tue May 01, 2012 5:47 pm Post subject: RE:drawpic issues? |
|
|
... firewall had something to do with drawing to screen from a buffer? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Tue May 01, 2012 6:37 pm Post subject: RE:drawpic issues? |
|
|
Sadly Yes... -_- I looked in the panic Logs... I couldnt get it to work without allowing Turing through my firewall. And its just windows normal Firewall... :S |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Tue May 01, 2012 7:00 pm Post subject: RE:drawpic issues? |
|
|
in the code that you've posted -- what was Turing trying to connect to? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|