How to draw a frame or border on an image?
-
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
-
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
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.
-
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
-
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
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 -
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
-
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
-
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
-
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
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
-
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
draw like this
OOOOO O. .O O 0 O O . O OOOOO ============== Regards, Sylvester G