Shapes at angles - how to?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Shapes at angles - how to?

  1. #1
    Join Date
    Feb 2007
    Location
    Arizona
    Posts
    15

    Shapes at angles - how to?

    I have an aerial photo of complex structures that are not at right angles to each other. I can easily display the photo in a PictureBox. What I need to do is overlay one or more colored shapes of specific structures over the base image when the structures are elsewhere selected. I can create any of the images in any format (bmp, jpg, gif, etc.). If I could rotate a Shape object, I'd be close to what I need. Problem is the shapes I need to display are not simple squares, rectangles, circles or ovals.

    An ImageList doesn't work because it is a complete image replacement per index selection. What I'm kinda trying to do is build an alarm monitor screen. When an alert occurs in a specific building, I just want to color highlight the specific building. Hope this makes sense

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    Why don't you use he Line method of the pictureBox control to draw any polygon you want? What you need is just the vertex coordinates
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    Feb 2007
    Location
    Arizona
    Posts
    15
    Yes, I could do that but would I be able to fill the polygon with a color?

  4. #4
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    No, sorry, you cannot....

    I do that using Windows API like CreatePolygonRgn, CreateSolidBrush, FillRgn (and of course region and brush must be deleted using DeleteObject)

    One of the many advantages: they are blazing fast compared to VB poor graphics.

    PS if you just want to highlight the borders of the building, you can do that using the Line method, drawing very THICK lines using the DrawWidth property
    Last edited by mstraf; 07-19-2010 at 07:38 PM.
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Similar Threads

  1. colliding shapes
    By pm4ck in forum C++
    Replies: 2
    Last Post: 08-17-2006, 10:23 AM
  2. keeping shapes on a canvas with a paint tool
    By javatrainee in forum Java
    Replies: 5
    Last Post: 11-06-2005, 03:52 PM
  3. Replies: 1
    Last Post: 08-17-2005, 07:42 PM
  4. Best practice for drag and drop shapes
    By marwick in forum Java
    Replies: 2
    Last Post: 08-04-2005, 10:00 PM
  5. Drawing custom shapes (Graphics2D)
    By AaronJM in forum Java
    Replies: 5
    Last Post: 05-09-2005, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center