Gluing bitmaps

Re: Gluing bitmaps

Postby Natter » Wed Dec 14, 2022 10:33 am

Bitmap files

https://cloud.mail.ru/public/4BD8/9WAeuMRyu

Code: Select all  Expand view
function Main
local hBmp, bmp1:="C:\TMP\map.bmp", bmp2:="C:\TMP\lgd.bmp"
local img:={FW_ReadImage( nil, bmp1 ), ; // [3],[4] are width and height
                  FW_ReadImage( nil, bmp2 )}
local oCommDlg, oFiles


  hBmp := FW_MakeYourBitmap( img[1,3]+10, img[1,4]+6, ;
                  { |hDC, w, h| PaintOverlay( hDC, w, h, img) } )

  PalBmpFree( img[1] )
  PalBmpFree( img[2] )

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

  DeleteObject( hBmp )

  ************************************************
  oCommDlg := FWGetOleObject( "WIA.CommonDialog" )
  oFiles   := FWGetOleObject( "WIA.Vector")

  if valtype(oFiles)="O"
     oFiles:Add(bmp1)
     oCommDlg:ShowPhotoPrintingWizard(oFiles)

  else
 ? "Not found WiaAut.dll"
  endif

return NIL

static function PaintOverlay( hDC, w, h, img)
local t,l

  FW_DrawImage( hDC, img[1] )

  t :=10 && top
  l := w - img[2, 3] - 20 && left

  FW_DrawImage( hDC, img[2], { t, l, t + img[2, 4], l + img[2, 3] } )
return nil
Last edited by Natter on Wed Dec 14, 2022 10:57 am, edited 1 time in total.
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 10:39 am

map.bmp is missing
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Natter » Wed Dec 14, 2022 10:45 am

Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 10:50 am

Now I get this:

Unresolved external '_HB_FUN_PAINTOVERLAY'
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Natter » Wed Dec 14, 2022 10:59 am

Excuse me

Code: Select all  Expand view
static function PaintOverlay( hDC, w, h, img)
local t,l

  FW_DrawImage( hDC, img[1] )

  t :=10 && top
  l := w - img[2, 3] - 20 && left

  FW_DrawImage( hDC, img[2], { t, l, t + img[2, 4], l + img[2, 3] } )
return nil
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:12 am

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

Ambiguous reference 'PR1'
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Natter » Wed Dec 14, 2022 11:18 am

pr1 this bmp1
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:19 am

Error description: (DOS Error -2147352567) WINOLE/1007 The system cannot find the file specified.
(0x80070002): WIA.CommonDialog.1
Args:
[ 1] = O WIA.Vector

Stack Calls
===========
Called from: => TOLEAUTO:SHOWPHOTOPRINTINGWIZARD( 0 )
Called from: natter.prg => MAIN( 26 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:21 am

Error description: Error BASE/1004 No exported method: SHOWPHOTOPRINTINGWIZARD
Args:
[ 1] = U
[ 2] = O WIA.Vector

Stack Calls
===========
Called from: => SHOWPHOTOPRINTINGWIZARD( 0 )
Called from: natter.prg => MAIN( 26 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:21 am

Where to get the WIA component from ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Natter » Wed Dec 14, 2022 11:25 am

https://cloud.mail.ru/public/aoZX/Y4f1Tif8H

This is WIAAUT.DLL to provide a standard print dialog. IT should be placed next to the .EXE file
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:27 am

I did it and also did: regsvr32 WIAAUT.DLL

but same errors...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:28 am

Can you provide an example that does not use WIA ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Gluing bitmaps

Postby Natter » Wed Dec 14, 2022 11:46 am

The problem was that after upgrading the libraries, I did not remove the LoadFreeImage() function from the program. Everything is fine now
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Gluing bitmaps

Postby Antonio Linares » Wed Dec 14, 2022 11:56 am

very good! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 26 guests