Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Line Drawing in Alpha

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Line Drawing in Alpha

    UI_SHAPE_LINETO()
    Code:
    ui_bitmap_create("test", 4, 2)
    ui_bitmap_draw("test", <<%code%
    set_origin(0,0)
    inner_rect(0, 0, 4, 2)
    set_pen("black")
    set_brush("green")
    ui_shape_start_poly("five", 1.5, .4)
    ui_shape_lineto("five", 3, .75)
    ui_shape_lineto("five", 2.3, 1.75)
    ui_shape_lineto("five", 1.4, 1.65)
    ui_shape_lineto("five", .75, 1)
    ui_shape_poly("five", 1.5, .4)
    fill_shape("five", 0,0)
    %code%)
    ui_dlg_box("", "{image=test}")
    The above code is from the wiki. I tried this in V11 Build 2373 and got just a single line.
    Tried in V8 Build 1980 and got the expected graphic. I sent in a bug report.
    Andrew

    Comment


      #17
      Re: Line Drawing in Alpha

      Originally posted by Stan Mathews View Post
      The data you show indicates line number, angle, and length.
      The line to command accepts start and end points.
      You need to translate line number, angle, and length into start and end points.
      May I request everyone to solve this problem in alpha Five? It's something like a coding contest, sorry, the winner will have no price, but members and alpha users will benefit from the solution.
      Last edited by JetLi; 02-22-2012, 07:54 PM.

      Comment


        #18
        Re: Line Drawing in Alpha

        I just tried this sample that Ira pointed to and it works just fine in v11 (I didn't study your example, Andrew, but I had the same problem):

        Code:
        ui_bitmap_create("test", 4, 2)
        ui_bitmap_draw("test",<<%code%
        inner_Rect(0, 0, 4, 2)
        set_pen("black", "Solid", 1)
        set_origin(2, 1)
        set_brush("green")
        start_poly(0, -.75)
        lineto(1, .25)
        lineto(-1, .25)
        fill_poly(0, -.75)
        set_rotate(30)
        set_brush("blue")
        start_poly(0, -.75)
        lineto(1, .25)
        lineto(-1, .25)
        fill_poly(0, -.75)
        %code%)
        ui_dlg_box("","{image=test}")
        Jet Li, you will have to study the graphic methods that Alpha provides. They are somewhat complex but you can do what you want. But it will require a fair amount of effort on your part.
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #19
          Re: Line Drawing in Alpha

          It's something like a coding contest, sorry, the winner will have no price, but members and alpha users will benefit from the solution.
          Why don't you solve it for us?

          I told the client i can do it in Alpha Five
          You should have said you couldn't.
          There can be only one.

          Comment


            #20
            Re: Line Drawing in Alpha

            'nuther approach with lots of flexibility:

            Code:
            dim instruction as c
            dim vfile as c 
            vfile = "c:\image_1.jpg"
            
            instruction = <<%a%
            convert -size 300x200 xc:lightblue -stroke darkgreen -strokewidth 2 -draw "line 5,35 195,5"%a%
            instruction = instruction + vfile
            
            flag = a5_runimagemagiccommand("", vfile, Instruction)
            sys_open(vfile)
            -Steve
            sigpic

            Comment


              #21
              Re: Line Drawing in Alpha

              Originally posted by Steve Workings View Post
              'nuther approach with lots of flexibility:
              Which doesn't change the need to convert points and bearings to X,Y coordinates.

              The a5_runimagemagiccommand() command can do a lot, but is primarily intended for images, although it can do drawing as well. Drawback (IMHO) is that it is creating a batch program to run an external program to process the commands. I'm not sure what the speed penalty is for that sequence, but I bet it's not particularly small.
              Regards,

              Ira J. Perlow
              Computer Systems Design


              CSDA A5 Products
              New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
              CSDA Barcode Functions

              CSDA Code Utility
              CSDA Screen Capture


              Comment


                #22
                Re: Line Drawing in Alpha

                Originally posted by Stan Mathews View Post
                Why don't you solve it for us?

                You should have said you couldn't.
                Yap sorry, i really should have said i could not do it.

                Comment


                  #23
                  Re: Line Drawing in Alpha

                  Originally posted by Steve Workings View Post
                  'nuther approach with lots of flexibility:

                  Code:
                  dim instruction as c
                  dim vfile as c 
                  vfile = "c:\image_1.jpg"
                  
                  instruction = <<%a%
                  convert -size 300x200 xc:lightblue -stroke darkgreen -strokewidth 2 -draw "line 5,35 195,5"%a%
                  instruction = instruction + vfile
                  
                  flag = a5_runimagemagiccommand("", vfile, Instruction)
                  sys_open(vfile)
                  Thank you so much for the effort,I'll try the given code, I really appreciate it very much.

                  I tried the code and it draws a single green line., how do i draw another line which connects to the edge of the first line then with a certain angle another line will be drawn?
                  Last edited by JetLi; 02-23-2012, 12:57 AM.

                  Comment


                    #24
                    Re: Line Drawing in Alpha

                    Jetson - I can get you started, which I have, but the next stuff, as Ira is also suggesting, is going to be up to you. While I and others may find this to be an interesting project, I don't know how much anyone will invest in it. I'll cheer anyone on who wants to do this.

                    For further help and ideas, Google imagemajick.
                    -Steve
                    sigpic

                    Comment


                      #25
                      Re: Line Drawing in Alpha

                      It can all be done in Alpha Five, or at least I am 99% sure it can. However, the learning curve for a relative novice to do it would be quite steep. Many years ago I wanted to produce a fairly simple chart based on data from amortization tables I generated in A5. The chart was to graphically show savings one could have by making different extra payments on a mortgage. Having zero experience with line drawing this way, it probably took me 2 solid weeks (maybe more!) to succeed but I did.

                      Below is an example of the result, every bit of it drawn with the code in the text file I have also attached (you can't run the code though because prior to the code for drawing the chart there is a ton of other code that generates the needed data). I include the code just so anyone interested can see an example of how complex things can get. That said, my hunch is that what is wanted in this thread may be much easier. But no, I am not am not up to the challenge of showing anyone how to do it.

                      BYW, I both showed the chart on screen and printed it, along with a cover letter.

                      Raymond Lyons

                      EDIT: One more possibly interesting thing about my work to produce the chart: It was done 9 years ago and through every upgrade to Alpha Five it has continued to work flawlessly through at least V 10.5, i.e., no need to fix or adjust anything due to changes in A5. But why do it in A5 when there are other easier ways (simple chart, excel, etc.)? All those other ways require that A5 continues to support those things, that upgrades to those things continue to work the same way with A5, and in the case of needed third party programs (even Excel!) that my customers have those programs or aren't put off by having to buy them--more and more people are learning that they don't really need things like MS Office. Also, with A5 I was able to automate the whole process (query to select a dozen or so records that need the letter and chart, do the processing for them, send the print job to the appropriate network color printer, record the date printed so it won't be done again, all with the push of a single button by the user once a month). Then too there is another reason to do it in A5: It is a good feeling to succeed at something that is quite challenging (at least it was quite challenging for me). I should add that my initial pay for completing the this addition to the application the chart is part of? Zero, and sadly, not a lot more since then since I have very little ambition in regard to selling things I create, and now I am 90% retired from all this stuff.

                      Int_saver.jpg
                      Attached Files
                      Last edited by Raymond Lyons; 02-23-2012, 01:33 PM.

                      Comment


                        #26
                        Re: Line Drawing in Alpha

                        One other thing, it may be obvious, but then again maybe not. You can hire a consultant to write code for your needs, and then incorporate that into your project. It may not be in your budget, but there are many Alpha Five consultants, myself, Steve, those listed at IADN, and many other consultants that can do that code.

                        And many consultants hire each other to work on certain portions that they are less expert in.

                        So that is another choice. BUT, if you have the time and ability, there is nothing better than writing your own code for satisfaction and accomplishment, as well as learning.

                        Your basic 1st steps would be to take the initial point, and calculate the next X,Y position based on bearing and length. This is simple algebra and Trigonometry. Then repeat for all the rest of the points. Once you can calculate that, you then have to place those points, possibly scaled and shifted in the X and Y, onto an image using whatever method you choose.
                        Regards,

                        Ira J. Perlow
                        Computer Systems Design


                        CSDA A5 Products
                        New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                        CSDA Barcode Functions

                        CSDA Code Utility
                        CSDA Screen Capture


                        Comment


                          #27
                          Re: Line Drawing in Alpha

                          if only you are all near so that I can probably hire anyone of you, although i could not afford one but must have to earn for it, the problem is, in our country, we cannot avail of a credit card if we are poor, credit cards are for the rich here in our place, we must present to the bank our proof of monthly income, i may have some option for payment but overseas transaction are expensive, e.g. Money transer from bank to bank, the charges might be expensive than your fee to complete the code.I'll just try my lick on this one.Thank you!

                          Comment


                            #28
                            Re: Line Drawing in Alpha

                            Jetli,

                            People on this board will usually try to help you. But what they won't do is write the application for you. You have to study the code examples on the WiKi and do trial & error and testing. That's what all developers do. Raymond Lyons gave you a code example that you can study. Look here on the WiKi as well:

                            http://alphafivewiki.com/Bitmap+and+Graphic+Functions

                            Study the various functions and try the examples. These functions and methods are not particularly easy, but they are workable. But again, YOU have to do this; we won't do it for you. When you encounter a particular problem go ahead and ask a question, but don't ask someone else to do your work. Do you see the difference?

                            Good luck to you!
                            Peter
                            AlphaBase Solutions, LLC

                            [email protected]
                            https://www.alphabasesolutions.com


                            Comment


                              #29
                              Re: Line Drawing in Alpha

                              Originally posted by csda1 View Post
                              One other thing, it may be obvious, but then again maybe not. You can hire a consultant to write code for your needs, and then incorporate that into your project. It may not be in your budget, but there are many Alpha Five consultants, myself, Steve, those listed at IADN, and many other consultants that can do that code.

                              And many consultants hire each other to work on certain portions that they are less expert in.

                              So that is another choice. BUT, if you have the time and ability, there is nothing better than writing your own code for satisfaction and accomplishment, as well as learning.

                              Your basic 1st steps would be to take the initial point, and calculate the next X,Y position based on bearing and length. This is simple algebra and Trigonometry. Then repeat for all the rest of the points. Once you can calculate that, you then have to place those points, possibly scaled and shifted in the X and Y, onto an image using whatever method you choose.
                              How much would it cost to hire you or your friends Ira for the code of the attached file? Thank you!

                              Comment


                                #30
                                Re: Line Drawing in Alpha

                                Another data.
                                Attached Files
                                Last edited by JetLi; 02-29-2012, 08:42 PM.

                                Comment

                                Working...
                                X