Results 1 to 2 of 2

Thread: Click and drag over a graphic?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    Click and drag over a graphic?

    I am planning to write a VB Graphics application. I want it to be possible to click and drag over the graphic to produce a rectangle.

    I have seen many commercial applications which produce a rectangle around a text area, or part of a graphic, in order to indicate what is to be moved or zoomed in on.

    If possible, I do not want to reinvent this wheel. Besides, maybe I could not reinvent it.

    I do not need code, just some hints.

    I am particularly wondering about how to quickly erase rectangles as the click and drag is being done. I assume that you must save the pixels overlaid by the lines and then redraw them, but do not know how to do this.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  2. #2
    Lively Member D.Viddy's Avatar
    Join Date
    May 2003
    Location
    Soldotna, Alaska
    Posts
    108
    Instead of saving hidden pixels, that isn't what you do. You will have a collection of all the objects that are on the stage. In each object you will store information of what is to displayed, how big it is, and where it should be displayed. Then you will have a subroutine that you pass the object key or index to and it will look at all that information and decide where to draw the selection rectangle and handles.
    To draw everything, you just loop through the collection and read all the information and draw everything accordingly. Then you decided what is selected and then you run your selection box subroutine. Get it? Email me for further help.
    ~Dylan
    ~http://www.codebend.net
    ~The place for Internet Development help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width