Drawing on a TImage and save [Solved]

Re: Drawing on a TImage and save [Solved]

Postby csincuir » Sat Sep 21, 2019 12:11 pm

Hi Uwi, thanks for answering.
I currently use the FWH June 2019 release
What I need is mark an image with a colored pencil, an X or circle, and then save the marked image.
Something similar to this your example

Image

Could you show me an example how I could do it, please.

Thanks in advance

Best regards
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Drawing on a TImage and save [Solved]

Postby cnavarro » Sat Sep 21, 2019 1:15 pm

The control you use is XImage?
If so, use the right button to display a popup menu that offers you the options you can use. If you don't want to use that menu at least, study the class, and the function / method that menu shows to know what method you have to use for what you need.

El control que utilizas es XImage?
Si es así utiliza el botón derecho para mostrar un menú popup que te ofrece las opciones que puedes utilizar. Si no quieres utilizar ese menu por lo menos, estudia la clase, y la function/method que muestra ese menú para saber qué method has de utilizar para lo que necesitas.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Drawing on a TImage and save [Solved]

Postby csincuir » Sun Sep 22, 2019 1:03 pm

Hola Cristobal, gracias por contestar.
Pues no utilizo aun ningún control, y busque XImage y me pareció bastante interesante la clase, pero, lo que necesito es poder hacer unas marcas sobre la imagen y no veo que haya nada en la clase sobre un lapiz o pencil, o algo para dibujar sobre la imagen. No tengo mucho conocimiento sobre tratamiento de imágenes por eso le preguntaba a Uwi si tenía un ejemplo de como hizo para ponerle lentes a la imagen que mostré en el post anterior.

Saludos cordiales.
Carlos


Hi Cristobal, thanks for answering.
Well, I don't use any control yet, and I looked for XImage and I found the class quite interesting, but what I need is to be able to make some marks on the image and I don't see anything in the class on a pen or pencil, or something to draw About the image. I don't have much knowledge about image processing, so that is why I asked Uwi if he had an example of how he did to put lenses on the image I showed in the previous post.

Best Regards
Carlos
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Drawing on a TImage and save [Solved]

Postby ukoenig » Sun Sep 22, 2019 2:12 pm

Carlos,

to draw on a xImage works as well
There are still some things to do.
I noticed saving the image, the pen of the saved image is shown in white and not red
Next the key-defines for painting must be different to predefined keys of xImage
like the right mouselick ( opens a menue )
These are just my first tests.
What's about drawing other forms like circles ( I have done with DGIPLUS ) :?:

Image

regards
Uwe :D
Last edited by ukoenig on Mon Sep 23, 2019 6:18 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Drawing on a TImage and save [Solved]

Postby csincuir » Sun Sep 22, 2019 3:27 pm

Hi Uwe,
The example ximage01.prg that you show in the image is the one I was testing,
but I didn't find a way to put the pencil, how did you do to paint the penguin's eyes?

Best regards
Carlos
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Drawing on a TImage and save [Solved]

Postby ukoenig » Sun Sep 22, 2019 4:56 pm

Carlos,

I added < oImage:bLDblClick > to activate and deactivate the linepainting
because right mouseclick and click are predefined
for menue and movement.

regards
Uwe :D
Last edited by ukoenig on Mon Sep 23, 2019 11:28 am, edited 5 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Drawing on a TImage and save [Solved]

Postby csincuir » Sun Sep 22, 2019 7:20 pm

Excellent Uwe, although as I told you, what I need is only to make a mark on the image and save the change
Thanks for your support.

Regards.
Carlos
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Drawing on a TImage and save [Solved]

Postby ukoenig » Mon Sep 23, 2019 6:19 pm

I finished the painter and still noticed some xImage-problems.
With the painter I can change the pensize and color at runtime

Left mouse-dblclick = start and end painting
moving the image or any action from the menu clears the lines

Download
http://www.pflegeplus.com/DOWNLOADS/xImage1.zip

problems :
1.) after saving to clipboard it is not possible to select another image from xbrowse
this can also be tested with the existing FWHsample
2.) the pencolor gets lost saving a image from the menu to file
saving a image to clipboard and past inside another app the color exists

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Drawing on a TImage and save [Solved]

Postby csincuir » Tue Sep 24, 2019 11:56 am

Nice work Uwe,
with this I have what I need to implement it in a development that I am doing,
thanks for your help.

Best regards.
Carlos
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests