FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TIMAGE and Blur
Posts: 1612
Joined: Fri Oct 07, 2005 05:56 PM

TIMAGE and Blur

Posted: Thu Jul 23, 2026 10:58 AM

Dear All,

I would like to show an image with TIMAGE but need to blur it. I try as testblu2.prg but it doesn't success.

Thanks for any help.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: TIMAGE and Blur

Posted: Thu Jul 23, 2026 03:25 PM

FiveWin does not have a direct native function or a specific command such as an "EFFECT BLUR" within the TImage or TBitmap class to blur images at runtime.

// C:\FWH2603\SAMPLES\IMGBLUR.PRG

#include "fivewin.ch"
#include "colores.ch"

FUNCTION Main()

   LOCAL oDlg, oImg
   LOCAL oFont, oBold
   LOCAL cArquivo := "..\bitmaps\olga1.jpg"
   LOCAL aRects := {                ;
            { 100, 100, 300, 300 }, ;
            {  50, 350, 350, 550 }, ;
            {  50, 600, 350, 980 } }

   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-20 UNDERLINE
   DEFINE FONT oBold NAME "VERDANA" SIZE 0,-24 BOLD

   DEFINE DIALOG oDlg TITLE "Displaying a Blurred Image in FiveWin In xHarbour" ;
      SIZE 650, 400 COLOR CLR_BLACK, CLR_WHITE TRANSPARENT

   oDlg:lHelpIcon := .F.
                             // 230, 180
   // @ 10, 10 xIMAGE oImg SIZE 230, 180 OF oDlg FILENAME cArquivo //FIT

   oDlg:bPainted := <|hDC|
      local aRect

  aRect := aRects[ 1 ]
  FW_BOX( hDC, aRect, { CLR_WHITE, 3 }, ;
     "..\bitmaps\olga1.jpg", ;
     { "My love", oBold, CLR_BLACK }, 2 )
  FW_EllipShadow( hDC, aRect, 20 )

  aRect := aRects[ 2 ]
  FW_BOX( hDC, aRect, { CLR_WHITE, 3 }, ;
     "..\bitmaps\olga1.jpg", ;
     { "My love", oFont, METRO_TURQUE }, 2 )
  FW_EllipShadow( hDC, aRect, 20 )

  return nil
  >

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()
   oBold:End()

RETURN NIL

// FIN / END - kapiabafwh@gmail.com

REgards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: TIMAGE and Blur

Posted: Thu Jul 23, 2026 03:34 PM

Maybe,

   GdipBitmapApplyEffect

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: TIMAGE and Blur

Posted: Fri Jul 24, 2026 03:31 AM

Dear Dutch,

Here's what's going on with your testblu2.prg and how to blur an image properly.

Why testblu2.prg doesn't work
Your sample doesn't actually use TIMAGE — it blurs the background of an XBROWSE and draws the result directly onto the browse's DC with PalBmpDraw() testblu2.prg:44-55 . The problem is that you paint the blurred bitmap once, then immediately release the DC. As soon as the browse repaints itself (scroll, focus change, etc.), it redraws its own background and your blurred output is erased. That's why nothing sticks.

Compare with testblur.prg, which works because the blurred bitmap is redrawn on every paint via the window's ON PAINT handler testblur.prg:42-43 . The Blur( hBmp, iRadio ) function is a real linkable FWH function (defined in source/internal/ribbon.c), so it's available to you ribbon.c:822-831 . Note it only accepts 24- or 32-bit bitmaps and returns 0 otherwise ribbon.c:835-841 .

Two clean ways to show a blurred image
Option A — Use TXImage (simplest)
TXImage (in source/classes/ximage.prg) has a built-in nBlur data member; assigning it applies a GDI+ blur and refreshes automatically ximage.prg:65-67 . The blur is applied in the GDI+ draw path via GDIP_DrawImage gdipfwh.cpp:873-881 .

@ 10, 10 XIMAGE oImg FILE "photo.jpg" SIZE 400, 300 OF oWnd
oImg:nBlur := 5
Note the GDI+ blur effect is guarded by USEEFFECTS, which requires a GDI+ 1.1 build; if that's not enabled in your FWH, nBlur will have no visible effect gdipfwh.cpp:861-893 .

Option B — Blur the bitmap and feed it to TIMAGE
If you specifically want TIMAGE, blur the loaded bitmap with Blur() and hand the resulting handle to the control with SetImage() timage.html:55 . This produces a persistent blurred image because TIMAGE/TBitmap redraws its own hBitmap on every paint bitmap.prg:762-781 .

I can create a working sample for either approach if you tell me which one you prefer. Below is a plan for Option B (blurring into a TIMAGE), since that matches your request most directly.

Create working TIMAGE blur sample
In repository FiveTechSoft/fwh, create a new sample PRG (e.g. samples/test/testblu3.prg) that demonstrates showing a blurred image using the TIMAGE control.

Context:

  • The existing samples/test/testblu2.prg fails because it draws a blurred bitmap directly onto an XBROWSE DC with PalBmpDraw() once and then releases the DC; the browse repaints and erases it. It also does not actually use TIMAGE.
  • FWH exposes a linkable function Blur( hBitmap, iRadio ) (defined in source/internal/ribbon.c) that returns a new blurred HBITMAP. It requires a 24- or 32-bit bitmap and returns 0 otherwise.
  • TIMAGE (source/classes/image.prg) has a SetImage( hBmp ) method that replaces the displayed bitmap; TIMAGE/TBitmap redraws its hBitmap on every paint, so the blurred image persists.

Implementation:

  1. Define a window with a TIMAGE control loaded from a BMP file (use cGetFile( "*.bmp", ... ) so the user can pick one, similar to testblur.prg).
  2. Load the bitmap handle (e.g. via PalBmpRead() or the image's own hBitmap).
  3. Add a button (or slider like testblur.prg) that calls Blur( hBmp, nRadius ) to produce a blurred handle, then calls oImg:SetImage( hBlur ) and oImg:Refresh() to display it.
  4. Make sure to DeleteObject() the previous blurred handle before creating a new one to avoid GDI leaks (as SetImage does not destroy the previous bitmap).
  5. Guard against Blur() returning 0 for non-24/32-bit bitmaps.

Expected outcome: A compilable, runnable sample where selecting a BMP shows it in a TIMAGE, and pressing the button (or moving a slider) shows the blurred version persistently, without being erased on repaint.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1612
Joined: Fri Oct 07, 2005 05:56 PM

Re: TIMAGE and Blur

Posted: Fri Jul 24, 2026 06:40 AM

Thanks Karinha, Thanks Antonio,

I use FWH2512, I try to use TXIMAGE and set ::nBlur := 5. It doesn't effect, nothing change. How much Min/Max of nBlur level?

Thank you in advance,

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: TIMAGE and Blur

Posted: Fri Jul 24, 2026 09:25 AM

What Windows version are you using ?

The GDI+ Blur effect additionally requires GDI+ version 1.1 (Windows Vista or later) to be available at runtime; on older GDI+ it silently does nothing.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1612
Joined: Fri Oct 07, 2005 05:56 PM

Re: TIMAGE and Blur

Posted: Fri Jul 24, 2026 09:30 AM

I use Windows11

Antonio Linares wrote:

What Windows version are you using ?

The GDI+ Blur effect additionally requires GDI+ version 1.1 (Windows Vista or later) to be available at runtime; on older GDI+ it silently does nothing.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: TIMAGE and Blur

Posted: Fri Jul 24, 2026 11:03 AM

This modified testblur.prg is working fine here:

#include "FiveWin.ch"
#include "Slider.ch"

STATIC oWnd, oBmp


FUNCTION Main()
local n
local oSlide1
local nVar1 := 0
local cFile := cGetFile( "*.bmp", "Select a BMP file" )
local hBmp
local hBlur
local oSay, cSay := Space( 11 )

   DEFINE WINDOW oWnd TITLE "Test Blur Effect"

   if !Empty( cFile )
      hBmp  = PalBmpRead( 0, cFile )
      hBlur = PalBmpRead( 0, cFile )[ 1 ]
   else
      return nil
   endif
   


   @ 0, nBmpWidth( hBmp[ 1 ] ) + 15  SLIDER oSlide1 VAR nVar1 OF oWnd ;
            VERTICAL ;
            TOP DIRECTION ;
            RANGE 0, 100;
            MARKS 10;
            SIZE 33, nBmpHeight( hBmp[ 1 ] ) PIXEL ;
            ON CHANGE( cSay:= AllTrim( STR( nVar1 ) ), ;
                       oSay:Refresh(), ;
                       DeleteObject( hBlur ),;
                       hBlur := Blur( hBmp[ 1 ], nVar1 ),;
                       oWnd:Refresh() )

   @ 0, oSlide1:nLeft + oSlide1:nWidth + 10 SAY oSay VAR cSay PIXEL OF oWnd


   ACTIVATE WINDOW oWnd ;
   ON PAINT( PalBmpDraw( hDC, 0, 0, If( nVar1 == 0, hBmp[ 1 ], hBlur ) ) )
              


RETURN ( nil )



#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>

void DoHBlur( INT iStart, INT iEnd, INT iRadio, BYTE *pbDestRGB, BYTE *pbSrcRGB, LONG *lTotalClrs, INT iBPP );
void DoHorizontalBlur( BITMAP SrcBmp, BYTE *pBmpDes, BYTE *pBmpBytes, INT iRadio );
void DoVBlur( INT iStart, INT iEnd, INT iRadio, BYTE *pBmpDes, BYTE *pBmpBytes, LONG *lTotalClrs, DWORD dwWidth, INT iCol, INT iBPP );
void DoVerticalBlur( BITMAP SrcBmp, BYTE *pBmpDes, BYTE *pBmpBytes, INT iRadio );


HBITMAP Blur( HBITMAP hSrcBmp, INT iRadio )
{
	 BITMAP SrcBmp;
   BITMAPINFO  sBmpInfo;
   BYTE *pBmpBytes, *pBmpDes, *pBmpHBlur;
   HBITMAP hbmDest, hbmSrc, hbmOldFrom, hbmOldDes, hbmOld, hbmOldBlur, hbmHBlur;
	 LONG i, j, lOffset;
   HDC dcSrc, dcDest, dcFrom, dcHBlur;

   if( iRadio == 0 )
      return 0;

   GetObject(hSrcBmp, sizeof( BITMAP ), &SrcBmp);

   #ifdef UNICODE
   if( (SrcBmp.bmBitsPixel != 32) )
     return 0;
   #else
   if( (SrcBmp.bmBitsPixel != 24) && (SrcBmp.bmBitsPixel != 32) )
     return 0;
   #endif
 
 
   sBmpInfo.bmiHeader.biSize         = sizeof(BITMAPINFOHEADER);
   sBmpInfo.bmiHeader.biWidth        = SrcBmp.bmWidth;
   sBmpInfo.bmiHeader.biHeight       = SrcBmp.bmHeight;
   sBmpInfo.bmiHeader.biBitCount     = SrcBmp.bmBitsPixel;
   sBmpInfo.bmiHeader.biPlanes       = 1;
   sBmpInfo.bmiHeader.biCompression  = BI_RGB;
   sBmpInfo.bmiHeader.biSizeImage    = SrcBmp.bmBitsPixel * SrcBmp.bmWidth * SrcBmp.bmHeight / 8;
         


  

   // Select HBITMAP Source ( hSrcBmp ) to Mem DC ( dcFrom )
   dcFrom      = CreateCompatibleDC( NULL );
   hbmOldFrom  = SelectObject( dcFrom, hSrcBmp );    

   hbmSrc  = CreateDIBSection( dcFrom, ( LPBITMAPINFO )&sBmpInfo,
                               DIB_RGB_COLORS, ( void ** )&pBmpBytes, 0, 0);
        

   dcSrc   = CreateCompatibleDC( NULL );                                        
                                                                                 

   hbmOld  = (HBITMAP) SelectObject( dcSrc, hbmSrc );                           
  

   // Fill the buffer with a copy of the bitmap's bits
   BitBlt( dcSrc, 0, 0, SrcBmp.bmWidth, SrcBmp.bmHeight, dcFrom, 0, 0, SRCCOPY );
   

   SelectObject( dcFrom, hbmOldFrom );
   DeleteDC( dcFrom );

   //Prepare Horizontal Bitmap Blur
   dcHBlur      = CreateCompatibleDC( NULL );   
   

   hbmHBlur     = CreateDIBSection( dcHBlur, ( LPBITMAPINFO )&sBmpInfo,
        DIB_RGB_COLORS, ( void ** )&pBmpHBlur, 0, 0);
        

   hbmOldBlur   = SelectObject( dcHBlur, hbmHBlur );    

   //Prepare Destination Bitmap   

   dcDest      = CreateCompatibleDC( NULL );

   hbmDest     = CreateDIBSection( dcDest, ( LPBITMAPINFO )&sBmpInfo,
        DIB_RGB_COLORS, ( void ** )&pBmpDes, 0, 0);
        

   hbmOldDes   = SelectObject( dcDest, hbmDest );       
   

 // Gaussian Horzintal blur bitmap 
 DoHorizontalBlur( SrcBmp, pBmpHBlur, pBmpBytes, iRadio );
 BitBlt( dcDest, 0, 0, SrcBmp.bmWidth, SrcBmp.bmHeight, dcHBlur, 0, 0, SRCCOPY );

   DoVerticalBlur( SrcBmp, pBmpDes, pBmpHBlur, iRadio );
		
   SelectObject( dcSrc, hbmOld );
   DeleteDC( dcSrc );
   DeleteObject( hbmSrc );
   

   SelectObject( dcHBlur, hbmOldBlur );
   DeleteDC( dcHBlur );
   DeleteObject( hbmHBlur );
   

   SelectObject( dcDest, hbmOldDes );
   DeleteDC( dcDest );
   

   return hbmDest;
}

//-------------------------------------------------------------------------------//

void DoHorizontalBlur( BITMAP SrcBmp, BYTE *pBmpDes, BYTE *pBmpBytes, INT iRadio )
{
   INT j;
   INT iBPP = SrcBmp.bmBitsPixel >> 3;
   

   for( j = 0; j < SrcBmp.bmHeight; j++ )
	 {
      LPBYTE pbDestRGB = ( LPBYTE )&( ( DWORD * ) pBmpDes   )[ j * SrcBmp.bmWidth ];
      LPBYTE pbSrcRGB  = ( LPBYTE )&( ( DWORD * ) pBmpBytes )[ j * SrcBmp.bmWidth ];		
      INT ky;
      LONG lTotalClrs[ 3 ];
      

  lTotalClrs[ 0 ] = 0;
  lTotalClrs[ 1 ] = 0;
  lTotalClrs[ 2 ] = 0;
  
  //First pixel
  for( ky = 0; ky <= iRadio; ky++ )
  {
     lTotalClrs[ 0 ] += pbSrcRGB[ ky * iBPP + 0 ];
		   lTotalClrs[ 1 ] += pbSrcRGB[ ky * iBPP + 1 ];
		   lTotalClrs[ 2 ] += pbSrcRGB[ ky * iBPP + 2 ];
		}
		pbDestRGB[ 0 ] = ( BYTE )( lTotalClrs[ 0 ] / ( iRadio + 1 ) );
		pbDestRGB[ 1 ] = ( BYTE )( lTotalClrs[ 1 ] / ( iRadio + 1 ) );
		pbDestRGB[ 2 ] = ( BYTE )( lTotalClrs[ 2 ] / ( iRadio + 1 ) );
		pbSrcRGB  += iBPP;
		pbDestRGB += iBPP;
 
  DoHBlur( 1, SrcBmp.bmWidth, iRadio, pbDestRGB, pbSrcRGB, lTotalClrs, iBPP );
   }
   

}

//-------------------------------------------------------------------------------//

void DoHBlur( INT iStart, INT iEnd, INT iRadio, BYTE *pbDestRGB, BYTE *pbSrcRGB, LONG *lTotalClrs, INT iBPP )
{
   INT i, ky;
   INT iAverage;
    

   for( i = iStart; i < iEnd; i++ )
   {
      iAverage = iRadio * 2 + 1;
  //Subtract pixel leave
      if( ( i - iRadio ) > 0 )
      {
         lTotalClrs[ 0 ] -= pbSrcRGB[ -iRadio * iBPP + 0 ];
         lTotalClrs[ 1 ] -= pbSrcRGB[ -iRadio * iBPP + 1 ];
         lTotalClrs[ 2 ] -= pbSrcRGB[ -iRadio * iBPP + 2 ];
      }
      else
      {
       iAverage += i - iRadio;
      }
    

  //Add pixel entering
  if( i + iRadio < iEnd )
  {
     lTotalClrs[ 0 ] += pbSrcRGB[ iRadio * iBPP + 0 ];
     lTotalClrs[ 1 ] += pbSrcRGB[ iRadio * iBPP + 1 ];
     lTotalClrs[ 2 ] += pbSrcRGB[ iRadio * iBPP + 2 ];
  }
  else
  {
     iAverage -= ( iRadio - iEnd + i ) + 1;
  }
  
  
  pbDestRGB[ 0 ] = ( BYTE )( lTotalClrs[ 0 ] / iAverage );
  pbDestRGB[ 1 ] = ( BYTE )( lTotalClrs[ 1 ] / iAverage );
  pbDestRGB[ 2 ] = ( BYTE )( lTotalClrs[ 2 ] / iAverage );
  pbSrcRGB  += iBPP;
  pbDestRGB += iBPP;
  
   }
}

//-------------------------------------------------------------------------------//

void DoVerticalBlur( BITMAP SrcBmp, BYTE *pBmpDes, BYTE *pBmpBytes, INT iRadio )
{
   INT j;
   INT iBPP = SrcBmp.bmBitsPixel >> 3;
   

   for( j = 0; j < SrcBmp.bmWidth; j++ )
	 {
      INT ky;
      LONG lTotalClrs[ 3 ];
      

  lTotalClrs[ 0 ] = 0;
  lTotalClrs[ 1 ] = 0;
  lTotalClrs[ 2 ] = 0;

  
  //First pixel
  for( ky = 0; ky <= iRadio; ky++ )
  {
     lTotalClrs[ 0 ] += pBmpBytes[ j * iBPP + ky * SrcBmp.bmWidth * iBPP + 0 ];
		   lTotalClrs[ 1 ] += pBmpBytes[ j * iBPP + ky * SrcBmp.bmWidth * iBPP + 1 ];
		   lTotalClrs[ 2 ] += pBmpBytes[ j * iBPP + ky * SrcBmp.bmWidth * iBPP + 2 ];
		}
		pBmpDes[ j * iBPP + 0 ] = ( BYTE )( lTotalClrs[ 0 ] / ( iRadio + 1 ) );
		pBmpDes[ j * iBPP + 1 ] = ( BYTE )( lTotalClrs[ 1 ] / ( iRadio + 1 ) );
		pBmpDes[ j * iBPP + 2 ] = ( BYTE )( lTotalClrs[ 2 ] / ( iRadio + 1 ) );
  DoVBlur( 1, SrcBmp.bmHeight, iRadio, pBmpDes, pBmpBytes, lTotalClrs, SrcBmp.bmWidth, j , iBPP);
   }
   

}

//-------------------------------------------------------------------------------//

void DoVBlur( INT iStart, INT iEnd, INT iRadio, 
              BYTE *pBmpDes, BYTE *pBmpBytes, 
              LONG *lTotalClrs, DWORD dwWidth, INT iCol, INT iBPP )
{
   INT i; 
   INT iAverage;

   for( i = iStart; i < iEnd; i++ )
   {
      iAverage = iRadio * 2 + 1;   

      //Subtract pixel leave
      if( ( i - iRadio ) > 0 )
      {
         lTotalClrs[ 0 ] -= pBmpBytes[ iCol * iBPP + ( i - iRadio ) * dwWidth * iBPP + 0 ];
         lTotalClrs[ 1 ] -= pBmpBytes[ iCol * iBPP + ( i - iRadio ) * dwWidth * iBPP + 1 ];
         lTotalClrs[ 2 ] -= pBmpBytes[ iCol * iBPP + ( i - iRadio ) * dwWidth * iBPP + 2 ];
      }
      else
      {
       iAverage += i - iRadio;
      }
    

  //Add pixel entering
  if( i + iRadio < iEnd )
  {
     lTotalClrs[ 0 ] += pBmpBytes[ iCol * iBPP + ( i + iRadio ) * dwWidth * iBPP + 0 ];
     lTotalClrs[ 1 ] += pBmpBytes[ iCol * iBPP + ( i + iRadio ) * dwWidth * iBPP + 1 ];
     lTotalClrs[ 2 ] += pBmpBytes[ iCol * iBPP + ( i + iRadio ) * dwWidth * iBPP + 2 ];
  }
  else
  {
     iAverage -= ( iRadio - iEnd + i ) + 1;
  }
  
  pBmpDes[ iCol * iBPP + i * dwWidth * iBPP + 0 ] = ( BYTE )( lTotalClrs[ 0 ] / iAverage );
  pBmpDes[ iCol * iBPP + i * dwWidth * iBPP + 1 ] = ( BYTE )( lTotalClrs[ 1 ] / iAverage );
  pBmpDes[ iCol * iBPP + i * dwWidth * iBPP + 2 ] = ( BYTE )( lTotalClrs[ 2 ] / iAverage );
  
   }
}

HB_FUNC( BLUR )
{
   hb_retnl( ( LONG ) Blur( ( HBITMAP ) hb_parnl( 1 ), hb_parni( 2 ) ) );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 668
Joined: Fri Oct 21, 2005 05:54 AM

Re: TIMAGE and Blur

Posted: Sun Jul 26, 2026 10:42 PM

Dear Antonio,

Very Nice Function. :D

-Ramesh Babu P

Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: TIMAGE and Blur

Posted: Mon Jul 27, 2026 01:57 PM

Master,

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ FiveWin for xHarbour 26.03 - Mar. 2026          Harbour development power  ³Ü
³ (c) FiveTech 1993-2026 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
Compiling...
xHarbour 1.3.2 Intl. (SimpLex) (Build 20260103)
Copyright 1999-2026, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'testblur.prg' and generating preprocessed output to 'testblur.ppo'...

Generating C source output to 'testblur.c'...
Done.

Lines 47, Functions/Procedures 1, pCodes 214
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
testblur.c:
Warning W8080 testblur.prg 142: 'lOffset' is declared but never used in function Blur
Warning W8080 testblur.prg 142: 'j' is declared but never used in function Blur
Warning W8080 testblur.prg 142: 'i' is declared but never used in function Blur
Warning W8080 testblur.prg 222: 'ky' is declared but never used in function DoHBlur
*** 1 errors in Compile ***
* Linking errors *

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: TIMAGE and Blur

Posted: Mon Jul 27, 2026 02:34 PM

hi,
i also have Problem to compile Source

TESTBLUR.c
c:\fwh64\0\BLUR\TESTBLUR.prg(94): error C2440: "=": "HGDIOBJ" kann nicht in "HBITMAP" konvertiert werden
c:\fwh64\0\BLUR\TESTBLUR.prg(94): note: Konvertierung von "void" in Zeiger auf nicht-"void" erfordert eine explizite Typumwandlung
c:\fwh64\0\BLUR\TESTBLUR.prg(114): error C2440: "=": "HGDIOBJ" kann nicht in "HBITMAP" konvertiert werden
c:\fwh64\0\BLUR\TESTBLUR.prg(114): note: Konvertierung von "void
" in Zeiger auf nicht-"void" erfordert eine explizite Typumwandlung
c:\fwh64\0\BLUR\TESTBLUR.prg(122): error C2440: "=": "HGDIOBJ" kann nicht in "HBITMAP" konvertiert werden
c:\fwh64\0\BLUR\TESTBLUR.prg(122): note: Konvertierung von "void*" in Zeiger auf nicht-"void" erfordert eine explizite Typumwandlung
LINK : fatal error LNK1181: Eingabedatei "c:\fwh64\0\BLUR\TESTBLUR.obj" kann nicht geöffnet werden.

  • Linking errors *
greeting,

Jimmy
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: TIMAGE and Blur

Posted: Mon Jul 27, 2026 09:55 PM

Dear Jimmy,

Fix: Cast the three assignments (line 101 already had the cast):

hbmOldFrom = ( HBITMAP ) SelectObject( dcFrom, hSrcBmp ); hbmOldBlur = ( HBITMAP ) SelectObject( dcHBlur, hbmHBlur ); hbmOldDes = ( HBITMAP ) SelectObject( dcDest, hbmDest );

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1612
Joined: Fri Oct 07, 2005 05:56 PM

Re: TIMAGE and Blur

Posted: Mon Aug 03, 2026 10:46 AM

Dear Antonio,

I got an error.

ฺฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฟ
ณ FiveWin for xHarbour 25.12 - Dec. 2025          Harbour development power  ณ
ณ (c) FiveTech 1993-2025 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ณ
ภฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤู
 ฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿฿
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20221118)
Copyright 1999-2022, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'testblur.prg' and generating preprocessed output to 'testblur.ppo'...
Generating C source output to 'testblur.c'...
Done.
Lines 47, Functions/Procedures 1, pCodes 214
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
testblur.c:
Error E2187 d:\bcc77\include\windows\sdk\prsht.h 920: Unexpected end of file in conditional started on line 21
Warning W8062 d:\bcc77\include\windows\sdk\prsht.h 921: Previous options and warnings not restored
Warning W8062 d:\bcc77\include\windows\sdk\commdlg.h 1272: Previous options and warnings not restored
Warning W8062 d:\bcc77\include\windows\sdk\windows.h 322: Previous options and warnings not restored
Warning W8062 testblur.prg 305: Previous options and warnings not restored
*** 1 errors in Compile ***
* Linking errors *

d:\FWH2512\samples>
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: TIMAGE and Blur

Posted: Mon Aug 03, 2026 07:55 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1612
Joined: Fri Oct 07, 2005 05:56 PM

Re: TIMAGE and Blur

Posted: Tue Aug 11, 2026 02:45 AM

Dear Antonio,

I can fixed it. Do testblur support .jpg file?

Thanks in advance,

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)