Support > Installation

Windows 2.1 RC1 install

<< < (3/4) > >>

btechint:
Yes

Support:
My error when building the zip, I included the "Dll_Pack" directory with the files within. Just copy the DLLs in this sub-directory back to \WINDOWS\System32. Sorry. I'll upload a new corrected zip. Here is the gdtest.sb program that comes with the distribution. It worked fine on my Windows XP SP3 box.


--- Code: ---import gd.bas

brush = gd::Create(10,10)
white = gd::Color(brush,255,255,255)
black = gd::Color(brush,0,240,0)
gd::Line brush,0,0,10,10,black
gd::Line brush,0,10,10,0,black

' gd::SavePng brush,"brush.png"

image = gd::Create(400,300)

white = gd::Color(image,255,255,255)
gd::SetTransparentColor image,white
black = gd::Color(image,0,0,0)
red =  gd::Color(image,255,0,0)
blue =  gd::Color(image,0,0,255)
green = gd::Color(image,0,255,0)

gd::Point image,0,0,black

gd::Rectangle image,200,50,250,100,red
gd::FilledRectangle image,225,75,275,125,green

gd::Rectangle image,324,190,376,290,black
gd::SetTile image,brush
' caused stack overflow on a fine NT? Should be some poor implementation
'gd::FillToBorder image,325,191,black,gd::Tiled

gd::Circle image,350,50,40,blue
gd::FillToBorder image,350,50,blue,green
gd::Fill image,201,51,blue

gd::SetBrush image,brush
gd::Line image,300,200,300,350,gd::Brushed

gd::SetColor image,black

gd::SetFont image,gd::FontTiny
gd::print image,0,0,"THIS PICTURE WAS CREATED FROM ScriptBasic USING THE MODULE GD/PNG"
gd::print image,0,10,"x=",gd::SizeX(image)," y=",gd::SizeY(image)
gd::print image,100,100,"Tiny ",12*3+55

gd::SetFont image,gd::FontSmall
gd::print image,100,120,"Small ",55*63

gd::SetFont image,gd::FontMedium
gd::print image,100,150,"Medium ",24/19

gd::SetFont image,gd::FontLarge
gd::print image,100,190,"Large ",sin(3.1)

gd::SetFont image,gd::FontGiant
gd::print image,100,240,"Giant ",log(1000)


for i=0 to 65 step 5
  gd::Line image,i,20,65-i,75
next i

LineStyle[0] = black
LineStyle[1] = black
LineStyle[2] = undef
LineStyle[3] = undef
LineStyle[4] = red
LineStyle[5] = green
LineStyle[6] = blue
LineStyle[7] = undef
LineStyle[8] = red
LineStyle[9] = red

gd::LineStyle image,LineStyle

gd::Line image,0,90,100,90,undef

for i=0 to 65 step 5
  gd::Line image,i,100,65-i,165,undef
next i


ImagePng = gd::Png(image)

gd::Destroy image

fn = 0
open "test.png" for output as fn
binmode fn
print#fn,ImagePng
undef ImagePng
close#fn

print "done\n"

--- End code ---

btechint:
I copied the dll's to the system32 dir. The gdtest ran ok, except. If you remove the comment from the gd::SavePNG command you will see the error that I am seeing. All my gd programs have been using the save command. It must be different now. Thanks
-----------------
import gd.bas

brush = gd::Create(10,10)
white = gd::Color(brush,255,255,255)
black = gd::Color(brush,0,240,0)
gd::Line brush,0,0,10,10,black
gd::Line brush,0,10,10,0,black

gd::SavePng brush,"brush.png" <-- command does not work

error

Support:
We are looking into the issue with SavePNG().

I noticed in Peter's (author) example program he did a raw write of the image string to disk using ScriptBasic standard file IO instead of using gd::SavePNG().  ???


--- Code: ---fn = 0
open "test.png" for output as fn
binmode fn
print#fn,ImagePng
undef ImagePng
close#fn

--- End code ---

I'll update this post when it's fixed.

Thanks for testing ScriptBasic, your feedback is very helpful !


John

btechint:
Thanks, looking forward to using the new GD library. Here is one of the little jobs I do with SB. This one works now after I changed the save routine. It just makes random colored images. I did not use the transparent color before and with the new library without it the image is 1 bit grayscale. After adding it in the image became a standard color png file.
-----------------
import gd.bas
randomize

for z=1 to 20

FOR G=1 TO 3
a=RND
B=INT(A)
C=RIGHT(B,3)
print c,"\n"
D[g]=c
NEXT G

image = gd::Create(800,600)
Color = gd::Color(image,D[1],D[2],D[3])
white = gd::Color(image,255,255,255)
gd::SetTransparentColor image,white

d="txr"&z&".png"

ImagePng = gd::PNG(image)

gd::Destroy image

fn = 0
open d for output as fn
binmode fn
print#fn,ImagePng
undef ImagePng
close#fn
         
next z
end

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version