EASy68K  
It is currently Sat Dec 16, 2017 1:05 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: how to show image
PostPosted: Fri Nov 16, 2012 9:08 am 
Offline

Joined: Thu Nov 15, 2012 7:29 pm
Posts: 13
Location: malaysia
i have a project and i have to show a image and a caption but i have no idea how to show that image... plx help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2012 4:21 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
What type of image?

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2012 1:37 am 
Offline

Joined: Thu Nov 15, 2012 7:29 pm
Posts: 13
Location: malaysia
i have to draw a picture something like a flag...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2012 2:56 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
EASy68K uses Trap tasks to draw. The Graphic Trap tasks are described in the EASy68K Help. Look in Simulator I/O, Graphics under the Contents tab.

The graphicSound program in the EASy68K/examples folder demonstrates the use of some of the trap tasks.

Here is a simple example that draws a dark blue rectangle with a light blue border.
Code:
    ORG    $1000
START
    move.l  #BLUE,d1
    move.b  #80,d0
    trap    #15         set pen color

    move.l  #NAVY,d1
    move.b  #81,d0
    trap    #15         set fill color

    move.l  #20,d1      X1 = 20
    move.l  #20,d2      Y1 = 20
    move.l  #60,d3      X2 = 60
    move.l  #60,d4      Y2 = 60
    move.b  #87,d0
    trap    #15         draw filled rectangle

    stop    #$2700      Stop Program

BLACK   EQU $00000000
MAROON  EQU $00000080
GREEN   EQU $00008000
OLIVE   EQU $00008080
NAVY    EQU $00800000
PURPLE  EQU $00800080
TEAL    EQU $00808000
GRAY    EQU $00808080
RED     EQU $000000FF
LIME    EQU $0000FF00
YELLOW  EQU $0000FFFF
BLUE    EQU $00FF0000
FUCHSIA EQU $00FF00FF
AQUA    EQU $00FFFF00
LTGRAY  EQU $00C0C0C0
WHITE   EQU $00FFFFFF

    END START

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Thu Nov 29, 2012 1:43 pm 
Offline

Joined: Thu Nov 15, 2012 7:29 pm
Posts: 13
Location: malaysia
thanx for your help. i need to know one more thing. i managed to draw a triangle using line but i need to know how to fill it with color.


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Thu Nov 29, 2012 4:02 pm 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
TRAP #15 task 89 - Flood Fill the area at X,Y with the fill color where X = d1.w and Y = d2.w

Lee.


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Thu Nov 29, 2012 7:56 pm 
Offline

Joined: Thu Nov 15, 2012 7:29 pm
Posts: 13
Location: malaysia
this is my triangle but still cannot fill the colour.
Code:
BLUE    EQU $00FF0000

START
   move.l  #BLUE,d1
   move.b  #80,d0
     trap    #15         set pen color
     
   move.l  #60,d1      X1 = 20
    move.l  #60,d2      Y1 = 20
      move.l  #80,d3      X2 = 60
       move.l  #20,d4      Y2 = 60
       move.b  #84,d0
       trap    #15         draw filled rectangle

   
   move.l  #BLUE,d1
   move.b  #80,d0
     trap    #15         set pen color
     
   move.l  #60,d1      X1 = 20
    move.l  #60,d2      Y1 = 20
      move.l  #20,d3      X2 = 60
       move.l  #20,d4      Y2 = 60
       move.b  #84,d0
       trap    #15         draw filled rectangle   

   move.l  #BLUE,d1
   move.b  #80,d0
     trap    #15         set pen color
     
   move.l  #20,d1      X1 = 20
    move.l  #20,d2      Y1 = 20
      move.l  #80,d3      X2 = 60
       move.l  #20,d4      Y2 = 60
       move.b  #84,d0
       trap    #15         draw filled rectangle
   
   move.l  #BLUE,d1
   move.b  #89,d0
     trap    #15         set pen color


   END   START      ; last line of source


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Thu Nov 29, 2012 8:22 pm 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
The fill point needs to be inside the area to be filled.

Lee.


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Thu Nov 29, 2012 8:30 pm 
Offline

Joined: Thu Nov 15, 2012 7:29 pm
Posts: 13
Location: malaysia
can u plx give an example. this is my first time using this program.


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Thu Nov 29, 2012 9:22 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
Code:
   ORG   $1000
START:            ; first instruction of program

BLUE    EQU $00FF0000

START
    move.l  #BLUE,d1
    move.b  #80,d0
    trap    #15         set pen color
     
    move.l  #60,d1      X1 = 60
    move.l  #60,d2      Y1 = 60
    move.l  #80,d3      X2 = 80
    move.l  #20,d4      Y2 = 20
    move.b  #84,d0
    trap    #15         draw line from X1,Y1 to X2,Y2
   
    move.l  #20,d1      X1 = 20
    move.l  #20,d2      Y1 = 20
    move.b  #85,d0
    trap    #15         draw line to X1,Y1

    move.l  #60,d1      X1 = 60
    move.l  #60,d2      Y1 = 60
    move.b  #85,d0
    trap    #15         draw line to X1,Y1
   
    move.l  #BLUE,d1
    move.b  #81,d0
    trap    #15         set fill color

    move.l  #40,d1      X1 = 40 put fill point inside triangle
    move.l  #21,d2      Y1 = 21
    move.b  #89,d0
    trap    #15         flood fill triangle

   MOVE.B   #9,D0
   TRAP   #15      ; halt simulator

* Variables and Strings

   END   START      ; last line of source

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Fri Nov 30, 2012 5:01 am 
Offline

Joined: Thu Nov 15, 2012 7:29 pm
Posts: 13
Location: malaysia
i really appreciate your help. now i have just one more question... i have finished drawing the image. now i need to write a caption at the bottom of the picture. but i cannot make it appear at the bottom. it always pops up inside the image.


Top
 Profile  
 
 Post subject: Re: how to show image
PostPosted: Fri Nov 30, 2012 2:00 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
Trap task #95

Draw the NULL terminated string of text at (A1) to screen location X,Y where X = D1.W & Y = D2.W.
The text is drawn as graphics and may not be read using trap task 22. Control characters are ignored.
X,Y specifies the location of the top left corner of the text.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group