FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour 驴C贸mo insertar una imagen dentro de otra imagen?
Posts: 492
Joined: Wed Nov 16, 2005 12:03 PM
驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Wed Dec 21, 2022 09:20 PM

Saludos

Estamos evaluando desarrollar una soluci贸n para odontolog铆a, la imagen del diente requiere asignarle im谩genes seg煤n el diagnostico.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Thu Dec 22, 2022 01:57 PM
Code (fw): Select all Collapse
function ImageOverlay()

聽 聽local aImage1, aImage2, hBmp
聽 聽local cFile1 聽 := "c:\fwh\bitmaps\olga1.jpg"
聽 聽local cFile2 聽 := "c:\fwh\bitmaps\alphabmp\calendar.bmp"
聽 聽local cSave 聽 聽:= "overlay.png"

聽 聽aImage1 聽:= FW_ReadImage( nil, cFile1 ) // [3],[4] are width and height
聽 聽aImage2 聽:= FW_ReadImage( nil, cFile2 )

聽 聽hBmp 聽 聽 := FW_MakeYourBitmap( aImage1[ 3 ], aImage1[ 4 ], ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 { |hDC, w, h| PaintOverlay( hDC, w, h, aImage1, aImage2 ) } )

聽 聽PalBmpFree( aImage1 )
聽 聽PalBmpFree( aImage2 )

聽 聽FW_SaveImage( hBmp, cSave ) // cSave can be bmp,jpg,png

聽 聽DeleteObject( hBmp )

聽 聽XImage( cSave ) // Test the saved image

return nil

static function PaintOverlay( hDC, w, h, aImage1, aImage2 )

聽 聽local t,l

聽 聽FW_DrawImage( hDC, aImage1 )

聽 聽t 聽 聽 := h - aImage2[ 4 ] - 20
聽 聽l 聽 聽 := w - aImage2[ 3 ] - 20

聽 聽FW_DrawImage( hDC, aImage2, { t, l, t + aImage2[ 4 ], l + aImage2[ 3 ] } )

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 492
Joined: Wed Nov 16, 2005 12:03 PM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Thu Dec 22, 2022 02:19 PM

Rao

Saludos y Muchas gracias.

Posts: 492
Joined: Wed Nov 16, 2005 12:03 PM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Thu Dec 22, 2022 02:27 PM

Rao

Saludos y gracias,

Actualmente utilizamos dos versiones de FW uno, muy viejo con xharbour .82 y otro con HB3.x, si es posible, la sintaxis con las funciones nativas de FW antes de implementar FW_FUNCTION.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Thu Dec 22, 2022 04:02 PM

What version of FWH you are using with Harbour?

Regards



G. N. Rao.

Hyderabad, India
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Thu Dec 22, 2022 10:06 PM
Juan, mira si estas lineas te sirven de algo.
Code (fw): Select all Collapse
cImage := GetPvProfString("Config","ImagenWnd",".\FapSoft.jpg",cIniFile)
聽 聽DEFINE BRUSH oBrush FILE cImage STRETCH // or RESIZE
聽 聽cImage2 := GetPvProfString("config","Image2",".\Zorra.jpg",cIniFile)

聽 聽DEFINE WINDOW oWnd MDI ;
聽 聽 聽 聽 聽 TITLE "WINCONT 聽 " ;
聽 聽 聽 聽 聽 BRUSH oBrush ; 聽
聽 聽 聽 聽 聽 ICON oIco

聽 聽//FW1204 Usando Bmp AlphaBlend con IMAGE 聽(Zorrita)
聽 聽@ 300, 60 IMAGE oImage2 FILENAME cImage2 NOBORDER SIZE 100,100 ADJUST OF oWnd:oWndClient 
聽 聽oWnd:bPainted := { || ABPaint( oWnd:oWndClient:hDC, 60, 300, oImage2:hBitmap, 255 ) }
Saludos.
Francisco J. Alegr铆a P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 492
Joined: Wed Nov 16, 2005 12:03 PM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Fri Dec 23, 2022 05:39 PM

Francisco,

Gracias.

Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Sun Jan 08, 2023 10:09 AM

Mr. Rao,

In your sample, can we also have multiply images combined ? Lets say Olga and then more then 1 layover on top.

For my webshop I see a interesting use of it...

  1. Do we have to save the first image with layover and then do the function with the new image and next layover ? etc....

  2. Or can we use the hBmp and do the conversion in 1 loop (No idea for the source sample ?)

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: 驴C贸mo insertar una imagen dentro de otra imagen?
Posted: Mon Jan 09, 2023 06:55 PM

You can put any number of images, paint text, etc in one go.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion