Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
eb35a848
Commit
eb35a848
authored
27 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Improved the English in the comments somewhat.
Rev: about_pike/draw_stuff.pike:1.3
parent
52bebb5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
about_pike/draw_stuff.pike
+8
-8
8 additions, 8 deletions
about_pike/draw_stuff.pike
with
8 additions
and
8 deletions
about_pike/draw_stuff.pike
+
8
−
8
View file @
eb35a848
#!/usr/local/bin/pike
#!/usr/local/bin/pike
// Information about Pike
is
found at: http://pike.indonex.se
// Information about Pike
can be
found at: http://pike.indonex.se
// This program
i
s made by hedda@id
e
nex.se to demonstrate the Image-
packag
e
// This program
wa
s made by hedda@id
o
nex.se to demonstrate the Image-
modul
e
// in Pike.
// in Pike.
// Program cleaned up and made readable by Fredrik Hubinette
// Program cleaned up and made readable by Fredrik Hubinette
// Some understanding of Pike or C is
assum
ed to understand this program.
// Some understanding of Pike or C is
need
ed to understand this program.
int main()
int main()
{
{
// Create an empy file object for file operations
// Create an emp
t
y file object for file operations
object(Stdio.File) file=Stdio.File();
object(Stdio.File) file=Stdio.File();
//Check if foo.ppm exists
//Check if foo.ppm exists
...
@@ -27,16 +27,16 @@ int main()
...
@@ -27,16 +27,16 @@ int main()
file->close(); // Close the file foo.ppm
file->close(); // Close the file foo.ppm
// Make another image called image2, this image has width=80 & high=40
// Make another image called image2, this image has width=80 & high
t
=40
// The image will be black
// The image will be black
.
object(Image.image) image2=Image.image(52, 65);
object(Image.image) image2=Image.image(52, 65);
// Set the current color to the Pike-green :)
// Set the current color to the Pike-green :)
//The color is coded (red, green, blue)
//The color is coded (red, green, blue)
// 0 means nothing of that color and 255 is maximum
// 0 means nothing of that color
-component
and 255 is maximum
image2->setcolor(160, 240, 192);
image2->setcolor(160, 240, 192);
// This draws a polygone. It's of cour
c
e anti-aliased!
// This draws a polygone. It's of cour
s
e anti-aliased!
image2->polygone(
image2->polygone(
({
({
4.1, 50, // First x,y corner
4.1, 50, // First x,y corner
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment