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. The Lounge
  3. How to draw a frame or border on an image?

How to draw a frame or border on an image?

Scheduled Pinned Locked Moved The Lounge
questionhelptutorial
9 Posts 8 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.
  • M Offline
    M Offline
    MostafaSayed
    wrote on last edited by
    #1

    I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

    V A R N A 7 Replies Last reply
    0
    • M MostafaSayed

      I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      MostafaSayed wrote:

      If my way is wrong, please tell me what is the right way.

      The right way is to ask in the right forum[^] :)

      Cheers, Vıkram.


      After all is said and done, much is said and little is done.

      1 Reply Last reply
      0
      • M MostafaSayed

        I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

        A Offline
        A Offline
        Abu Mami
        wrote on last edited by
        #3

        Pastel colors are nice. Don't use crayons, the result doesn't look polished enough.

        1 Reply Last reply
        0
        • M MostafaSayed

          I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

          R Offline
          R Offline
          Rohde
          wrote on last edited by
          #4

          Mr. Mostafa, Your problem is very complex - actually it belongs to a class of problems known as NP-complete[^]. These types of problems are amongst the most difficult class of problems in computer science. Actually if I remember correctly you can win a big pile of money if you can either show a solution or show that a solution in fact does not exist. But, your problem can be solved approximately. You need to use the Visitor pattern, combine it with both the Command and Decorator pattern. Also by utilizing Lemma 3.4 in the seminal computational geometry book "Computational Geometry - What is it good for?" by Peter Gausss, you should be able to solve your problem. When you have done that, write up an article and submit it to SIGGRAPH. Yours truly, Jacob


          "When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
          -Atlas Shrugged, Ayn Rand

          1 Reply Last reply
          0
          • M MostafaSayed

            I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

            N Offline
            N Offline
            NormDroid
            wrote on last edited by
            #5

            Paint them them all with vivid and sometime subtle colours, you'll find gardening a whole lot easier.

            P Think of the environment; please don't print this message unless you really need to.

            1 Reply Last reply
            0
            • M MostafaSayed

              I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

              A Offline
              A Offline
              ArtiBen
              wrote on last edited by
              #6

              If you resize the image to be greater than the frame, doesn't it stand to reason that it will appear outside of the frame...????

              Ben Glancy Software Developer Articad Ltd

              G 1 Reply Last reply
              0
              • A ArtiBen

                If you resize the image to be greater than the frame, doesn't it stand to reason that it will appear outside of the frame...????

                Ben Glancy Software Developer Articad Ltd

                G Offline
                G Offline
                Gizz
                wrote on last edited by
                #7

                Not if you trim it with a modelling knife

                1 Reply Last reply
                0
                • M MostafaSayed

                  I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

                  A Offline
                  A Offline
                  ArtiBen
                  wrote on last edited by
                  #8

                  Sounds like you're talking about the draw priority of the images. And who knows what you're talking about in terms of programming/image editors? Programmatically (with GDI+ for example: You shouldn't have to make the frame transparent. If you draw the frame first, then draw the image to be viewed in the frame second. Voila. Don't scale the image to be viewed in the frame bigger than the frame, it makes no sense anyway does it? With an art tool of some kind: Most 2d art tools have the concept of layers or draw priority, have the frame as a background layer and the image to be viewed as a foreground layer. Oh, don't draw the foreground layer bigger bigger than the background layer. Of course if you really need the image to be viewed in the frame to be larger than the background frame image, but not visible outside the frame... You can use a chroma key colour. The chroma key colour would be inside the viewing area of the frame. Your viewing image would be slotted inside wherever this colour is. This colour must not be present in the frame itself or you will get your viewing image bleeding into it. That is, unless you can define the area of the viewing area of the frame, which means you could just as easily crop your viewing image without the hassle of a chroma system. Next time, give more details of your problem.

                  Ben Glancy Software Developer Articad Ltd

                  1 Reply Last reply
                  0
                  • M MostafaSayed

                    I want to draw an image inside another image, this another image is a frame or border image, the frame or border image contains its figure and the part to display my target image through it, when I make the viewing part transparent and draw the image through the frame it work correctly, but if I resized the image to be greater than the frame, parts of the image will appear outside the frame. This is my problem. If my way is wrong, please tell me what is the right way. Mostafa Sayed Software Developer

                    S Offline
                    S Offline
                    Sylvester george
                    wrote on last edited by
                    #9

                    draw like this

                    OOOOO
                    O. .O
                    O 0 O
                    O . O
                    OOOOO
                    ==============

                    Regards, Sylvester G

                    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