Computer Science Canada
Programming C, C++, Java, PHP, Ruby, Turing, VB
Username:
Password:
Register
Wiki
Blog
Search
Turing
Chat Room
Members
How do I import a picture into my program
Index
->
Programming, Turing
->
Turing Help
Author
Message
Kenster102.5
Posted:
Wed Dec 20, 2006 6:59 pm
Post subject: How do I import a picture into my program
I am taking computer engineering at school and am wondering how do I import a picture into a program so it acts as a background for the program?
Thank you
Sponsor
Sponsor
Prince Pwn
Posted:
Wed Dec 20, 2006 7:33 pm
Post subject: (No subject)
Start by making the variable for the picture:
code:
var backgroundPic : int
Then make it equal to the directory of your picture. eg:
code:
backgroundPic := Pic.FileNew("C:/Documents and Settings/"+Sys.getUserName+"/My Documents/My Pictures/background.bmp")
Now to draw it, put it inside your main loop before you draw anything alse and do:
code:
Pic.Draw(backgroundPic,x,y,picCopy)
Prince Pwn
Posted:
Wed Dec 20, 2006 7:36 pm
Post subject: (No subject)
X and Y are also usually 0 when making a background picture, and you can also use
code:
picMerge
in place of
code:
picCopy
if you wish to blend it in with stuff beneath it, which doesn't really matter if that's your background image.
Bunny_Man_OC
Posted:
Wed Dec 20, 2006 7:50 pm
Post subject: (No subject)
Prince Pwn wrote:
code:
backgroundPic := Pic.FileNew("C:/Documents and Settings/"+Sys.getUserName+"/My Documents/My Pictures/background.bmp")
you can also put the picture in the same folder as the turing program that will be ussing it. if you do this then you simply need to put
code:
backgroundPic := Pic.FileNew ("backgroundPic.bmp")
Pic.Draw (backgroundPic,0,0,picCopy)
ericfourfour
Posted:
Wed Dec 20, 2006 10:01 pm
Post subject: (No subject)
Prince Pwn wrote:
Start by making the variable for the picture:
code:
var backgroundPic : int
Then make it equal to the directory of your picture. eg:
code:
backgroundPic := Pic.FileNew("C:/Documents and Settings/"+Sys.getUserName+"/My Documents/My Pictures/background.bmp")
With the above poster's code this can be reduced further to:
code:
var backgroundPic := Pic.FileNew ("backgroundPic.bmp")
Turing will figure out the data type for you (as long as it is predefined).
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
Index
->
Programming, Turing
->
Turing Help
Page
1
of
1
[ 5 Posts ]
Jump to:
Select a forum
CompSci.ca
------------
- Network News
- General Discussion
General Forums
-----------------
- Hello World
- Featured Poll
- Contests
Contest Forums
-----------------
- DWITE
- [FP] Contest 2006/2008
- [FP] 2005/2006 Archive
- [FP] 2004/2005 Archive
- Off Topic
Lounges
---------
- User Lounge
- VIP Lounge
Programming
--------------
- General Programming
General Programming Forums
--------------------------------
- Functional Programming
- Logical Programming
- C
C
--
- C Help
- C Tutorials
- C Submissions
- C++
C++
----
- C++ Help
- C++ Tutorials
- C++ Submissions
- Java
Java
-----
- Java Help
- Java Tutorials
- Java Submissions
- Ruby
Ruby
-----
- Ruby Help
- Ruby Tutorials
- Ruby Submissions
- Turing
Turing
--------
- Turing Help
- Turing Tutorials
- Turing Submissions
- PHP
PHP
----
- PHP Help
- PHP Tutorials
- PHP Submissions
- Python
Python
--------
- Python Help
- Python Tutorials
- Python Submissions
- Visual Basic and Other Basics
VB
---
- Visual Basic Help
- Visual Basic Tutorials
- Visual Basic Submissions
Education
-----------
- Student Life
Graphics and Design
-----------------------
- Web Design
Web Design Forums
---------------------
- (X)HTML Help
- (X)HTML Tutorials
- Flash MX Help
- Flash MX Tutorials
- Graphics
Graphics Forums
------------------
- Photoshop Tutorials
- The Showroom
- 2D Graphics
- 3D Graphics
Teams
------
- dTeam Public
Style:
Appalachia
blueSilver
eMJay
subAppalachia
subBlue
subCanvas
subEmjay
subGrey
subSilver
subVereor
Search:
You can syndicate this boards posts using the file
backend.php
or view the
topic map using sitemap.php.
Terms of Use
|
Privacy Policy