1. Images & frames or Border
- Posted by SergioGelli Jul 27, 2010
- 1038 views
Hello friends
Sorry because my 'Google's English", again. ;)
I need to study how to put frames around images.
In other words, I want to put edges on images, but these edges should be themed like flowers and other beautiful things.
How can I do this with Euphoria?
2. Re: Images & frames or Border
- Posted by DanM Jul 27, 2010
- 1034 views
Haven't tried it, but if you're making a Windows pgm, I think you could make a child window centered in a larger window, make a "background" image in the main window of whatever pretty "wallpaper" you want for the frame (border), and then put the image you want to present into the child window.
3. Re: Images & frames or Border
- Posted by SergioGelli Jul 27, 2010
- 1011 views
It would not be possible to make an image with the center with the transparent color?
Thus, the edges would be placed on the main image.
But I do not know how. Any idea?
4. Re: Images & frames or Border
- Posted by mattlewis (admin) Jul 27, 2010
- 985 views
It would not be possible to make an image with the center with the transparent color?
Thus, the edges would be placed on the main image.
But I do not know how. Any idea?
What are you planning to do with the image? Are you just displaying it in a program? What platform / libraries do you use?
If you are simply displaying the images in a window of an application, you can use the double buffer technique (Derek demonstrated this a few posts ago). Basically, draw or blit your background image onto the pixmap, then draw / blit your actual image into the center. Finally, blit the entire thing back to your window.
Matt
5. Re: Images & frames or Border
- Posted by SergioGelli Jul 27, 2010
- 1003 views
At first I want to use the Windows XP platform and, if possible, portable to Vista and Seven versions. It will be ok if possible can develop it with the library win32lib.
I plan to develop a program which will open a window about the size of the screen. After that, drop into it, one or more images. Once the images are in the main window, routines need to do to change size, contrast, put frames, words and other services.
I tried to find the post from Derek with the text "double buffer", but found nothing. Could you tell more details?
6. Re: Images & frames or Border
- Posted by DerekParnell (admin) Jul 27, 2010
- 979 views
It would not be possible to make an image with the center with the transparent color?
Thus, the edges would be placed on the main image.
But I do not know how. Any idea?
You could do it that way, but that is the harder method.
An easier way is to draw the frame image, then draw the picture image over the top of that, but offset so you don't cover up the 'frame' edges.
For example, if you have a picture that is 800 x 600 pixels in size, and you want a 20-pixel frame around it, you could do this ...
- build or resize the frame image to be 840 x 640 pixels
- draw the frame image onto the canvas at position X,Y
- draw the picture image onto the canvas at position X+20,y+20
This would end up with a 20-pixel frame around the picture.
The term double buffering refers to a technique of build up the 'screen' image in an off-screen area of RAM and when you need to see that image, you copy it to an on-screen control. The reason you would do this is that drawing to an off-screen area is faster than drawing directly onto a visible window control. The effect is that users do not see the image being constructed in front of their eyes, but only see the final fully-built image.
In Win32lib terms, this means using a Pixmap control as the drawing canvas, on which you build your image and then using one of the 'blit' routines to place your image onto the Window. The 'blit' is a very, very fast way of copying pixels from one area to another.
Double-buffering is usually used when doing animations. Your program would have a final-image canvas and a number of other canvases that have partial images on them. For example, you could have a 'background' image and a number of 'sprite' images. You would copy the background to the final-canvas, then copy your sprites to various places on that canvas and then once the image is ready, copy it to the main display port. And while the user is looking at the displayed scene, your program is calculating the next position of the sprites etc ... and building the next scene. If your program is fast enough (and that is not all that hard to do) then effect is to give the user a smooth 24-frames or more per second of flicker-free animation.
A lot of 2D platform games uses 'tiles' to create a background. The tiles are small images that are placed together (or overlapped) to build up the complete background for the current scene. This building is done 'off-screen' so the user does not see the process happening. Once the background is complete, the foreground sprites are added and then the image is displayed.
7. Re: Images & frames or Border
- Posted by sergelli Jul 27, 2010
- 1013 views
Thanks for the reply, Derek
If I am understanding correctly, that code "\win32Lib\demo\WordCatcher.exw" is an example of using double-buffering. Is that correct? Could report more examples?
8. Re: Images & frames or Border
- Posted by DerekParnell (admin) Jul 28, 2010
- 1029 views
Thanks for the reply, Derek
If I am understanding correctly, that code "\win32Lib\demo\WordCatcher.exw" is an example of using double-buffering. Is that correct?
Yes.
Could report more examples?
Not from memory.
9. Re: Images & frames or Border
- Posted by SergioGelli Jul 28, 2010
- 974 views
I am studying what features should I use this to start my new project.
I want to make a system to create pages with multiple photos.
Basically, the pages will always be the same size.. The photos will be posted on these pages, may have various sizes, limited by the size of the page.
After inserting a picture in a page, the program will offer resources for: 1-Load or remove borders 2-Cut parts of the image 3-Zoom in or out 4-Insert texts 5-and so on....
I know the project is ambitious, I know I am not aware for this and I have to learn many things.
So now I'm having issues: I think the library win32Lib only works with image files of type. Bmp That is true?
How do I work with other types of graphics files? Would should I use Gdiplus Al Getz Graphics Library? This library is compatible with win32Lib?