Insert a photo

Insert a photo

Postby Natter » Tue Nov 06, 2018 2: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 ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Insert a photo

Postby cnavarro » Tue Nov 06, 2018 6:42 pm

Assign data lCanPaste := .T., and press button right over control TXImage

Code: Select all  Expand view


   @ 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Insert a photo

Postby Natter » Tue Nov 06, 2018 7:06 pm

Thank you for your help !

Can I save an image from TXImage to a variable ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Insert a photo

Postby cnavarro » Tue Nov 06, 2018 7: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Insert a photo

Postby Natter » Tue Nov 06, 2018 8: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
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Insert a photo

Postby nageswaragunupudi » Thu Nov 08, 2018 1:15 pm

hBitmap := oImage:GetHBitmap()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Insert a photo

Postby Natter » Fri Nov 09, 2018 7:09 am

the GetHBitmap() function will return the handle of the picture.
I need the text of picture
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Insert a photo

Postby nageswaragunupudi » Fri Nov 09, 2018 7:29 am

text of picture?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Insert a photo

Postby Natter » Fri Nov 09, 2018 8: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() )
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Insert a photo

Postby nageswaragunupudi » Sun Nov 11, 2018 5:21 pm

BmpToStr( oImage:GetHBitmap() )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Insert a photo

Postby Mulyadi » Wed Jun 12, 2019 1:10 am

Mr Nages,

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

Thanks.
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am

Re: Insert a photo

Postby nageswaragunupudi » Wed Jun 12, 2019 2:05 am

Please set
Code: Select all  Expand view

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

Image

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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Insert a photo

Postby Mulyadi » Wed Jun 12, 2019 2:33 am

Thanks Mr Nages.
Best Regard..
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 96 guests