FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Insert a photo
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Insert a photo
Posted: Tue Nov 06, 2018 02:08 PM

Hi, all !

There is an object of type TXImage. I need to insert a photo from the Clipboard into it. How could I possibly do that ?

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Insert a photo
Posted: Tue Nov 06, 2018 06:42 PM
Assign data lCanPaste := .T., and press button right over control TXImage

Code (fw): Select all Collapse
   @ 300, 300 XIMAGE oImage SIZE 300, 300 ;
      OF oWnd SOURCE "ejemplo.png" NOBORDER 

   oImage:lCanPaste := .T.
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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Insert a photo
Posted: Tue Nov 06, 2018 07:06 PM

Thank you for your help !

Can I save an image from TXImage to a variable ?

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Insert a photo
Posted: Tue Nov 06, 2018 07:26 PM

I do not understand well
Please, explain better

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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Insert a photo
Posted: Tue Nov 06, 2018 08:44 PM

The TXImage class has a Save method that allows you to save the image only to a file. I need to save the image to a variable

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Insert a photo
Posted: Thu Nov 08, 2018 01:15 PM

hBitmap := oImage:GetHBitmap()

Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Insert a photo
Posted: Fri Nov 09, 2018 07:09 AM

the GetHBitmap() function will return the handle of the picture.
I need the text of picture

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Insert a photo
Posted: Fri Nov 09, 2018 07:29 AM

text of picture?

Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Insert a photo
Posted: Fri Nov 09, 2018 08:55 AM

I need to save the picture to BLOB. I can do this
buf=memoread ("my.jpg")
blobdirectput(0, buf)

But is it possible to do so ?
blobdirectput(0, image:GetHBitmap() )

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Insert a photo
Posted: Sun Nov 11, 2018 05:21 PM

BmpToStr( oImage:GetHBitmap() )

Regards



G. N. Rao.

Hyderabad, India
Posts: 85
Joined: Mon Apr 18, 2011 02:32 AM
Re: Insert a photo
Posted: Wed Jun 12, 2019 01:10 AM

Mr Nages,

Can you post here sample how to handle the Paste Image..?

Thanks.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Insert a photo
Posted: Wed Jun 12, 2019 02:05 AM
Please set
Code (fw): Select all Collapse
oImage:lCanPaste := .t.

if you want the user to paste images into the XImage control.

Then the user can
1. Copy an image from any source
2. Select the ximage by clicking on it
3) (a) Press Ctrl-V
OR
(b) Right-click on ximage and select "Paste" option from the context menu



If you want to paste thorugh program, you can use oImage:Paste() even if oImage:lCanPaste is not set to .t.
Regards



G. N. Rao.

Hyderabad, India
Posts: 85
Joined: Mon Apr 18, 2011 02:32 AM
Re: Insert a photo
Posted: Wed Jun 12, 2019 02:33 AM

Thanks Mr Nages.
Best Regard..

Continue the discussion