Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 need to make the ebay logo in turing...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cmt




PostPosted: Sat Dec 17, 2005 4:14 pm   Post subject: need to make the ebay logo in turing...

i need to make the ebay logo in turing and i need help... its for a project and im stuggling... its due on the 23rd so if someone can help me id really appreciate it...
Sponsor
Sponsor
Sponsor
sponsor
dani190




PostPosted: Sat Dec 17, 2005 4:20 pm   Post subject: (No subject)

what do you need help with what part, drawing it?
Cervantes




PostPosted: Sat Dec 17, 2005 4:32 pm   Post subject: (No subject)

Go to ebay and grab their logo. Save it as a .bmp, or .jpg. Make sure you save it to the same folder that your turing program is located in.

You can assign a variable to 'represent' the picture, using Pic.FileNew.
code:

var ebay_logo : int := Pic.FileNew ("ebay_logo.bmp")

You can then draw it using Pic.Draw.
It takes parameters. The first is the picture variable; in this case, it's ebay_logo. Next two parameters represent an ordered pair, (x, y). They locate the bottom left corner of the image. The next parameter is a little confusing: it represents the style of drawing. There are a few; the two most common are picCopy and picMerge, picCopy will just copy the picture directly onto the screen. picMerge will draw the picture on the screen with the transparent colour removed. By default, the transparent colour is white, though you can change this with Pic.SetTransparentColour.
code:

Pic.Draw (ebay_logo, 100, 150, picMerge)


We've got a tutorial on drawing with pictures. You can find it by quickly scanning through the Turing Walkthrough.
cmt




PostPosted: Sat Dec 17, 2005 5:17 pm   Post subject: ebay logo in turing

the two image loading codes dont work... i need to know how to write a code
for it... ive seen people in my class do it but they wont even let me look at thier codes or help me.... so it has been done manually and im looking for it like that...[/center][/url][/list][/list][/quote]



eBayLogoTM.jpg.gif
 Description:
this is the logo..
 Filesize:  1.28 KB
 Viewed:  3792 Time(s)

eBayLogoTM.jpg.gif


Cervantes




PostPosted: Sat Dec 17, 2005 5:52 pm   Post subject: (No subject)

A .jpg.gif file? I wonder if that's a result of that idiotic feature that windows has to hind extensions of known file types.

I'm going to assume that's a .gif image. Turing can't support .gif images, unless you have the elusive Turing v4.1. Open the file in Paint or some other image editing program and save it as a .jpg or .bmp file.

Try that, then try the image loading code again. It should work. Smile
cmt




PostPosted: Sat Dec 17, 2005 7:07 pm   Post subject: ebay logo in turing

hu do i put it on the output screen??? i have

var mypic : int := Pic.FileNew ("eBayLogoTM.jpg")
locate (20, 30)
put mypic

iz that it??? it doesnt work so i dont know..
[Gandalf]




PostPosted: Sat Dec 17, 2005 7:14 pm   Post subject: (No subject)

lol, I love the way you are doing it currently

You use Pic.Draw (picVar, x, y, drawMode).

Cervantes, I don't think that Windows saved the file with that extention. Since the file on their site is a .gif, he most probably saved it as ebay.jpg and then it automatically added the extention .gif because that's what it really is. Besides, it's the person's fault for not turning off that 'feature'.

Forgive this defence of Windows, but t'is true (or so I believe). :)
Cervantes




PostPosted: Sat Dec 17, 2005 7:54 pm   Post subject: (No subject)

[Gandalf] wrote:

Cervantes, I don't think that Windows saved the file with that extention. Since the file on their site is a .gif, he most probably saved it as ebay.jpg and then it automatically added the extention .gif because that's what it really is. Besides, it's the person's fault for not turning off that 'feature'.


I assumed that he saved it as it was named, then renamed it in windows explorer or whatever. Except it only shows "ebay_logo" or whatever it's called, so he changes that to "ebay_logo.jpg", and then suddenly you've got a "ebay_logo.jpg.gif". Always remember to turn this "feature" off when you're doing programming contest, lest you can't open the input file, for it is actually "data11.txt.txt".
Sponsor
Sponsor
Sponsor
sponsor
Geminias




PostPosted: Sun Dec 18, 2005 1:01 pm   Post subject: (No subject)

Quote:
var mypic : int := Pic.FileNew ("eBayLogoTM.jpg")
locate (20, 30)
put mypic


cmt, for the love of god... cervantes spent his time in the first post explaining how you import a picture and display it on the screen.

read his post again. (hint: pay particular attention to how 'put mypic' was never a part of his instruction...

pffff, i mean... people spend their time helping you the least you could do is listen to them.
[Gandalf]




PostPosted: Sun Dec 18, 2005 2:45 pm   Post subject: (No subject)

Yeah, I noticed that too, after I made my post. Would have edited it,but... Snooty

Cervantes' instructions are much more thorough than mine, and if you had read them then there would be no need to pm me. Smile
ecliptical




PostPosted: Wed Dec 21, 2005 4:32 am   Post subject: (No subject)

This should work....
code:
procedure IMGSRC (url : string, scale : int, alt : string)
    var netStream : int
    var net_line : char
    netStream := Net.OpenURLConnection (url)
    if netStream <= 0 then
        put "Unable to download jpeg ", url, "!"
        return
    end if
    var fileNo : int
    open : fileNo, "render.jpg", write
    loop
        exit when eof (netStream)
        get : netStream, net_line
        write : fileNo, net_line
    end loop
    Net.CloseConnection (netStream)
    close : fileNo
    var newPic : int
    newPic := Pic.FileNew ("render.jpg")
    var width : int := Pic.Width (newPic)
    var height : int := Pic.Height (newPic)
    newPic := Pic.Scale (newPic, scale * width,
        scale * height)

    Pic.Draw (newPic, 23, 23, picCopy)
    Pic.Free (newPic)
end IMGSRC

IMGSRC ("http://72.29.76.231/~eclipti/turing/picture.jpg", 1, "")

Tony




PostPosted: Wed Dec 21, 2005 9:36 am   Post subject: (No subject)

Well there's always Delta's Pic~2~Code Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: