I made
on Hwselction
if lOK
aControl[2]:cText := alltrim(Hw->Inventario)
aControl[3]:cText := alltrim(Hw->type)+" "+" Marca: "+;
alltrim(Hw->Marca)+" "+" Modello: "+alltrim(Hw->Modello)
aControl[20]:cResname := ltrim(STR(AScan( aItems, Trim( HW->type ))))
endif
on Pripara.prg
@ 5, 133 BUTTON oBtnSel PROMPT "..." OF oFldMat:aDialogs[1] PIXEL SIZE 10, 9 ;
ACTION (HwSeleccion( cInventario, aGet, oDlg ),;
cbmp:=aGet[20]:cresname ,;
nmsgbox(cBmp),;
aGet[20]:Refresh())
@ 2, 250 BITMAP aGet[20] RESOURCE oggettoBmp[val(trim(cBmp))] NOBORDER PIXEL;
OF oFldMat:aDialogs[1] SIZE 20,20 UPDATE
Now I have a number , I can select the number of array oggettoBmp[val(trim(cBmp))] but it not refresh the bitmaps
any idea
bitmap changed from user - RESOLVED !!!
Re: bitmap changed from user
Silvio,
that cannot work !
@ 2, 250 BITMAP aGet[20] RESOURCE oggettoBmp[val(trim(cBmp))] NOBORDER PIXEL;
OF oFldMat:aDialogs[1] SIZE 20,20 UPDATE
To change a Bitmap from resource is easy :
a Sample for xBrowse ( shows Bitmaps with different Colors )

oBrw:bLClicked := { | nRow, nCol | IIF( oLbx1:nArrayAt = 1, oBMP:SetBMP( "Black" ) , NIL ), ;
IIF( oLbx1:nArrayAt = 7, oBMP:SetBMP( "Red" ), NIL ) }
To display a Image from File, You have to add :
aGet[20]:bPainted := {|hDC| < Your drawing-function > }
Next You need only a Refresh like < aGet[20]:Refresh() > to show a new Image.
here is a Sample with File-selection :
that cannot work !
@ 2, 250 BITMAP aGet[20] RESOURCE oggettoBmp[val(trim(cBmp))] NOBORDER PIXEL;
OF oFldMat:aDialogs[1] SIZE 20,20 UPDATE
To change a Bitmap from resource is easy :
a Sample for xBrowse ( shows Bitmaps with different Colors )

oBrw:bLClicked := { | nRow, nCol | IIF( oLbx1:nArrayAt = 1, oBMP:SetBMP( "Black" ) , NIL ), ;
IIF( oLbx1:nArrayAt = 7, oBMP:SetBMP( "Red" ), NIL ) }
To display a Image from File, You have to add :
aGet[20]:bPainted := {|hDC| < Your drawing-function > }
Next You need only a Refresh like < aGet[20]:Refresh() > to show a new Image.
here is a Sample with File-selection :
Code: Select all | Expand
@ 30, 300 IMAGE oBmp FILENAME NIL OF oDlg SIZE 80, 50 PIXEL NOBORDER
oBMP:bPainted := {|hDC| DRAW_BRUSH(oBMP, hDC, cImage)}
// ---------- IMAGE-BRUSH ------------
FUNCTION DRAW_BRUSH( oBitmap, hDC, cFile )
LOCAL oNewBrush
LOCAL aRect := GETCLIENTRECT( oBitmap:hWnd )
IF FILE ( cFile ) // Image adjusted
DEFINE IMAGE oNewbrush FILENAME cFile
PalBmpDraw( hDC, 0, 0, oNewbrush:hBitmap, , aRect[4], aRect[3] )
ELSE
IF !EMPTY( cFile )
MsgAlert( "File : " + CRLF + cFile + CRLF + "not found !!!", "Error" )
ENDIF
ENDIF
RETURN( NIL )
Last edited by ukoenig on Thu Mar 10, 2011 11:48 am, edited 3 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: bitmap changed from user
Silvio
you save the position here
after
WE told you... use LoadImage...
In the start you use...
use same code in Button Action...
this is a not correct way... but you dont need change the Arrays
you save the position here
Code: Select all | Expand
aControl[20]:cResname := ltrim(STR(AScan( aItems, Trim( HW->type ))))
after
Code: Select all | Expand
cbmp:=aGet[20]:cresname ,;
WE told you... use LoadImage...
In the start you use...
Code: Select all | Expand
@ 2, 250 BITMAP aGet[20] RESOURCE oggettoBmp[val(ltrim(cBmp))] NOBORDER PIXEL;
OF oFldMat:aDialogs[1] SIZE 20,20 UPDATE
use same code in Button Action...
Code: Select all | Expand
@ 5, 133 BUTTON oBtnSel PROMPT "..." OF oFldMat:aDialogs[1] PIXEL SIZE 10, 9 ;
ACTION (HwSeleccion( cInventario, aGet, oDlg ),;
cbmp:=aGet[20]:cresname ,;
aGet[20]:LoadImage( oggettoBmp[val(ltrim(cBmp))] ),;
aGet[20]:Refresh())
this is a not correct way... but you dont need change the Arrays
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: bitmap changed from user
OK thanks Now run ok
Thanks Daniel, Thanks James

Thanks Daniel, Thanks James

Best Regards, Saludos
Falconi Silvio
Falconi Silvio
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: bitmap changed from user - RESOLVED !!!
Falconi,
Glad to hear you got it working.
Your interface is looking very nice!
Regards,
James
Glad to hear you got it working.
Your interface is looking very nice!
Regards,
James
Re: bitmap changed from user - RESOLVED !!!
thanks it is a project for a hardware support at mine school ( i work there)
Best Regards, Saludos
Falconi Silvio
Falconi Silvio