Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Scaling and moving graphics paths

Scaling and moving graphics paths

Scheduled Pinned Locked Moved Visual Basic
graphicshelpquestionlearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cnurse
    wrote on last edited by
    #1

    Hi all, hope you are having a bug free weekend! I have attempted to write a function which scales and translates a graphics path. If you describe a path as a square, I want to be able to draw your path twice...the first time using the size you specified in the path, then the second time I want to move it and reduce it (scale it down) by a specific number of pixels. I attempted to write code to do this, but I fear my limited mathematical abilities are whats causing me to see rather odd results in size and position. The thing is I DO NOT want to reduce the second drawn path by a percentage. I want to move it in by X,Y pixels then of course reduce its width by X*2 pixels and Y*2 pixels, so that the second shape always stays centralised with respect to the first. What this would mean is that I can have user defined button shapes, where I can maintain somekind of consistent look with pre-programmed rectangular and circular buttons which have gradient filled borders. Can anybody offer me some code which produces a matrix that causes a translation and appropriate scaling factors to produce the required results? I think I only need the code to set the appropriate matrix properties, so you don't need to give me a big story. I will look at your code and probably see where my own is lacking. Thanks in advance. Nursey. Nursey

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups