Correct serrated or burr losangle after drawing a diamond polygon

Camila Gomes Victorino stargateatlantis0 at gmail.com
Mon Jan 13 16:10:29 UTC 2014


Hi David!
Thank you for your answer!
As I wrote my TrialProc as a queue of InLines (each one composing a canvas, 
showing different figures until feedback), using the Slide Image would 
create other canvas, different from the others and I don`t know if it is 
possible to mix two canvas in one, for example, some inline figures to the 
Images in SlideImage, all at once, so
I employed your idea, creating two images.bmp (one with left diamond and 
right square and other with right diamond and left square) and created a 
row in the TrialList, called TargetImage, linking each image file to a 
specific target in the trialList. After that, I came back to the Inline 
where the serrated diamond was written and tried to write the code to load 
and show this two images, based on the TrialList. The problem is I am 
having trouble to discover what to do.

In the part where the serrated diamond was written, I changed to:
'Show targets
If c.getattrib("Target") = "Diamond" Then
c.getattrib("TargetImage") = "DiamondLeft.bmp"
Else
'Write a Diamond
c.getattrib("TargetImage") = "DiamondRight.bmp"
End If

When I compile it says: "Can't assign to constant". I suspect I need to 
load the images first but I don`t know how to do it! Or I need to declare 
and set the bmp file (no clues!!). 

Other solution I figured out was to write a code to load and show the 
images directly. For example:
'Show targets
If c.getattrib("Target") = "Diamond" Then
"WRITE" = "DiamondLeft.bmp"
Else
'Write a Diamond
"WRITE" = "DiamondRight.bmp"
End if

The problem is I tried everything! I went to E-prime Help and copied and 
tried to use Canvas.LoadImage, ImageDisplay.Filename and ImageDisplay.Load 
but I`ve never succeed! 
Maybe it is a simple answer but I am a novice in programming. Any advice?

Thank you for your help!
Regards, Camila.

Em quinta-feira, 9 de janeiro de 2014 19h24min20s UTC, McFarlane, David 
escreveu:
>
> Hmm.  I normally decline to look at extensive code samples or 
> attached programs, but you made it very easy and I was curious.  So I 
> ran your code, and indeed got bad jagged edges for the diamonds.  I 
> thought I could just attribute this to low Display resolution (640 x 
> 480 default), but got the same bad results at all other resolutions 
> (max 1680 x 1050 on my machine), working with either EP1 or EP2.  So 
> it seems that the E-Basic Canvas.Polygon command simply does not do a 
> good job of anti-aliasing (see 
> http://en.wikipedia.org/wiki/Spatial_anti-aliasing for background 
> information). 
>
> Instead, you should make image files for your diamond and other 
> shapes, then simply load those images to the Display as needed.  This 
> has the advantage that you can use good software to prepare your 
> images and it will simplify your E-Basic code as you can simply 
> redraw the same image to different defined locations. 
>
> Come to think of this, using image files and Slides, you should be 
> able to do this with no E-Basic code at all (I should have thought of 
> this first, as this is the norma E-Prime way!).  Just make a Slide 
> with SlideImage sub-objects to hold your square and diamond images, 
> then use attribute references from a List to assign the Position X & 
> Y properies for each of those sub-objects.  Easy-peasy (as long as 
> you do not need too many diamond angles)! 
>
> ----- 
> David McFarlane 
> E-Prime training 
> online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx 
> Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster ) 
>
> /---- 
> Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
> take any and all questions at https://support.pstnet.com , and they 
> strive to respond to all requests in 24-48 hours, so make full use of 
> it.  3) In addition, PST offers several instructional videos on their 
> YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do 
> get an answer from PST staff, please extend the courtesy of posting 
> their reply back here for the sake of others. 
> \---- 
>
>
> At 1/8/2014 09:56 AM Wednesday, Camila Gomes Victorino wrote: 
> >I have a binary decision making task where the subject needs to find 
> >out the diamond or losangle in one of the two sides. In the other 
> >one, there is a square and it needs to be identical to the diamond 
> >(just the angle position changes). I tried to draw the losangle and 
> >it worked, the problem is that the stimulus appears with serrated or 
> >burr sides. I tried to fix it putting the cnvs.penwidth and 
> >modifying it but it changes a lot the diamond and it needs to be 
> >identical to the square. I do not know how to fix it and get the 
> >serrated burrs out. 
> > 
> >I wrote the code as this: 
> > 
> >  'Declare variables 
> >Dim r, centerX, centerY As Integer 
> > 
> >'Create canvas 
> >Set cnvs = Display.Canvas 
> >cnvs.FillColor = CColor("White") 
> >cnvs.Clear 
> > 
> >'Create fixation point 
> >cnvs.TextColor = CColor ("black") 
> >cnvs.FontName = "Courier New" 
> >cnvs.FontSize = "18" 
> >cnvs.FontBold = CLogical("Yes") 
> >cnvs.Text 313, 228, "+" 
> > 
> >'Create gray squares 
> >cnvs.Pencolor = CColor("Gray") 
> >cnvs.Fillcolor = CColor("White") 
> >cnvs.Rectangle 255, 205, 55, 62 
> >cnvs.Rectangle Display.XRes -310, 205, 55, 62 
> > 
> >'Show targets 
> >cnvs.Pencolor = CColor("black") 
> >cnvs.Fillcolor = CColor("black") 
> >If c.getattrib("Target") = "Diamond" Then 
> >'Write a left diamond 
> >Dim P (4) As Point 
> >P(0).x = 280 
> >P(0).y = 218 
> >P(1).x = 296 
> >P(1).y = 239 
> >P(2).x = 280 
> >P(2).y = 256 
> >P(3).x = 265 
> >P(3).y = 239 
> >cnvs.Polygon P, 4 
> > 
> >cnvs.Rectangle 345, 222, 25, 30 
> >Else 
> >'Write a Rectangle 
> >cnvs.Rectangle 270, 222, 25, 30 
> >'Write a Diamond 
> > 
> >Dim L (4) As Point 
> >L(0).x = 357 
> >L(0).y = 218 
> >L(1).x = 373 
> >L(1).y = 239 
> >L(2).x = 357 
> >L(2).y = 256 
> >l(3).x = 342 
> >L(3).y = 239 
> >cnvs.Polygon L, 4 
> > 
> > 
> >End If 
> > 
> >Sleep (1000) 
> > 
> >Thank you! 
> >Best regards, 
>
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/dcc3a442-d83a-421a-913f-3dc15ec035fe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20140113/2b8d5286/attachment.htm>


More information about the Eprime mailing list