If I define on init a bitmap with :
#define BMP_H 40
#define BMP_V 40
and then on my application make bitmaps with this size
For nX := 1 To TOTX
@ nrow, ncol BITMAP aBmps[ nY, nX ] RESOURCE "VUOTO" OF oDlg;
SIZE BMP_H, BMP_V PIXEL ADJUST NOBORDER
ncol:=ncol+BMP_V
Next nX
If I want chage the size from user
How I can make ?
sample:
#define BMP_H 40
#define BMP_V 40
function config()
Local odlgconfig, lsave,oBtn
Local oGet[2]
Local nBMP_H := BMP_H
Local nBMP_V := BMP_V
DEFINE DIALOG oDlgConfig TITLE "Configurazione griglia" ;
FROM 2, 2 TO 13, 40
@ 10, 5 say "File :" SIZE 40, 13 pixel OF oDlgConfig
@ 30, 5 say "Colonne :" SIZE 40, 13 pixel OF oDlgConfig
@ 10, 30 GET nBMP_H VAR oGet[1] SIZE 40, 13 pixel OF oDlgConfig
@ 30, 30 GET nBMP_V VAR oGet[2] SIZE 40, 13 pixel OF oDlgConfig
@ 3, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 OF oDlgConfig ;
ACTION ( oDlgConfig:End(), lsave:=.t. ) DEFAULT
@ 3, 14 BUTTON "&Cancel" SIZE 45, 12 OF oDlgConfig ;
ACTION ( oDlgConfig:End(), lsave:=.f. )
ACTIVATE DIALOG oDlgConfig CENTERED
* BMP_H := nBMP_H
* BMP_V := nBMP_V
RETURN NIL
First
Why I cannot write into the get ?
Second
then How I refresh a defined variable ?
change the size of a bitmap
Re: change the size of a bitmap
Hello Sylvio,
Best Regards
Uwe![Laughing :lol:](./images/smilies/icon_lol.gif)
Code: Select all | Expand
For nX := 1 To TOTX
aBmp[ nY, nX ]:nWidth() := nHORZ // new Value
aBmp[ nY, nX ]:nHeight() := nVERT // new Value
aBmp[ nY, nX ]:Refresh()
Next nX
Best Regards
Uwe
![Laughing :lol:](./images/smilies/icon_lol.gif)
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.
Re: change the size of a bitmap
Uwe I try it but then all bitmaps are moved look it please
First
![Image](http://img210.imageshack.us/img210/6741/firstt.jpg)
then
![Image](http://img141.imageshack.us/img141/2287/then.jpg)
this is the function :
First
![Image](http://img210.imageshack.us/img210/6741/firstt.jpg)
then
![Image](http://img141.imageshack.us/img141/2287/then.jpg)
this is the function :
Code: Select all | Expand
#define ZOOM_H 5
#define ZOOM_V 5
STATIC function ZoomIn()
Local nY, nX
lOCAL nRow
Local nCol
local nNewHeigth
local nBottom
local nRight
nRow := aBmps[ 1, 1 ]:nTop
nCol := aBmps[ 1, 1 ]:nLeft
nBottom := aBmps[ 1, 1 ]:nBottom
nRight := aBmps[ 1, 1 ]:nRight
For nY := 1 to TOTY
For nX := 1 To TOTX
aBmps[ nY, nX ]:nTop := nRow
aBmps[ nY, nX ]:nLeft := nCol
aBmps[ nY, nX ]:nWidth += ZOOM_V
aBmps[ nY, nX ]:nHeight += ZOOM_H
ncol += aBmps[ nY, nX ]:nWidth +ZOOM_V
nNewHeigth := aBmps[ nY, nX ]:nHeight +ZOOM_H
Next nX
nCol := 0
nRow += nNewHeigth
Next nY
aBmps[ nY, nX ]:refresh()
return nil
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Re: change the size of a bitmap
Silvio,
I had a look at Your Screenshots,
There is a defined Gridsize ( Position Left, Upper ) where You paint the BMP's.
In case You change the Size of the BMP, the Grid must be adjusted as well, before the new BMP
is painted with a new Size.
If You don't resize the Grid, the BMP's are shown interleaved, because the Left- Upper-Position of the BMP is defined in Relation to the Grid.
That means, at first the Grid-Size must be changed ( zoomed ) to the new Size.
Best Regards
Uwe![Laughing :lol:](./images/smilies/icon_lol.gif)
I had a look at Your Screenshots,
There is a defined Gridsize ( Position Left, Upper ) where You paint the BMP's.
In case You change the Size of the BMP, the Grid must be adjusted as well, before the new BMP
is painted with a new Size.
If You don't resize the Grid, the BMP's are shown interleaved, because the Left- Upper-Position of the BMP is defined in Relation to the Grid.
That means, at first the Grid-Size must be changed ( zoomed ) to the new Size.
Best Regards
Uwe
![Laughing :lol:](./images/smilies/icon_lol.gif)
Last edited by ukoenig on Sun Aug 09, 2009 10:18 pm, edited 1 time 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.
Re: change the size of a bitmap
there is none grid !!
they are all bitmaps ....!!!!!
I you see a grid is only a eye game
they are all bitmaps ....!!!!!
I you see a grid is only a eye game
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: change the size of a bitmap
What Uwe is saying is still somewhat true if you are using a browse or not.
If you change the size of the bitmaps you are going to have to compensate for this by changing where they are drawn on the screen.
If you were using a browse then the browse would figure out the new locations as long as the row height and column width was adjusted to the new dimensions. However, I seem to remember that there was a reason that you couldn't use a browse for this.
James
If you change the size of the bitmaps you are going to have to compensate for this by changing where they are drawn on the screen.
If you were using a browse then the browse would figure out the new locations as long as the row height and column width was adjusted to the new dimensions. However, I seem to remember that there was a reason that you couldn't use a browse for this.
James
Re: change the size of a bitmap
James,
I think after resizing, a new calculation is needed for the BMP-positions like You can see
on the Screenshot-part.
![Image](http://www.pflegeplus.com/pictures/grid1.jpg)
Best Regards
Uwe![Laughing :lol:](./images/smilies/icon_lol.gif)
I think after resizing, a new calculation is needed for the BMP-positions like You can see
on the Screenshot-part.
![Image](http://www.pflegeplus.com/pictures/grid1.jpg)
Best Regards
Uwe
![Laughing :lol:](./images/smilies/icon_lol.gif)
Last edited by ukoenig on Sun Aug 09, 2009 10:31 pm, edited 1 time 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.
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: change the size of a bitmap
Uwe,
>I think after resizing, a new calculation is needed for the BMP-positions like You can see
on the Screenshot-part.
Yes, that is what I was trying to say. New row and col positions will be needed for each bitmap. This may be less complicated than it seems, since you can do it two loops.
for nRow
for nCol = 1 to ...
...
next nCol
next nRow
James
>I think after resizing, a new calculation is needed for the BMP-positions like You can see
on the Screenshot-part.
Yes, that is what I was trying to say. New row and col positions will be needed for each bitmap. This may be less complicated than it seems, since you can do it two loops.
for nRow
for nCol = 1 to ...
...
next nCol
next nRow
James
Re: change the size of a bitmap
this is the function draw the bitmaps
oPanel is a dialog
STATIC FUNCTION AssegnaBitmaps_NEW ( aBmps, aData, oPanel, nItem)
Local nY, nX
lOCAL nRow:=20
Local nCol:=BMP_V
Local oGet[TOTY]
local nFila:=1,x:=1
nY := 1
nX := 1
@ 5, 5 say "Fila" OF oApp:oPanel PIXEL SIZE BMP_H,BMP_V
For nY := 1 to TOTY
oGet[ nY ] := tget():new(nRow, nCol-BMP_V, SetGet( nY ), oApp:oPanel, BMP_H, BMP_V, "99",,,,,,,.t. )
oGet[ nY ]:lReadOnly:=.t.
For nX := 1 To TOTX
@ nrow, ncol BITMAP aBmps[ nY, nX ] RESOURCE "VUOTO" OF oApp:oPanel ;
SIZE BMP_H, BMP_V PIXEL ADJUST NOBORDER
ncol:=ncol+BMP_V
Next nX
@ nRow, nCol say ny OF oApp:oPanel PIXEL SIZE BMP_V,BMP_V COLOR CLR_BLACK,nRGB( 240, 232, 188 ) BORDER
nRow += BMP_H
nCol := BMP_V
Next nY
nCol:=BMP_V
For t=1 to Totx
@ nRow, nCol say t OF oApp:oPanel PIXEL SIZE BMP_H,BMP_V COLOR nRGB( 3, 56, 147 ),nRGB( 255, 255, 220 ) BORDER
nCol:=nCol+BMP_V
Next t
return nil
How I can resolve it ?
oPanel is a dialog
STATIC FUNCTION AssegnaBitmaps_NEW ( aBmps, aData, oPanel, nItem)
Local nY, nX
lOCAL nRow:=20
Local nCol:=BMP_V
Local oGet[TOTY]
local nFila:=1,x:=1
nY := 1
nX := 1
@ 5, 5 say "Fila" OF oApp:oPanel PIXEL SIZE BMP_H,BMP_V
For nY := 1 to TOTY
oGet[ nY ] := tget():new(nRow, nCol-BMP_V, SetGet( nY ), oApp:oPanel, BMP_H, BMP_V, "99",,,,,,,.t. )
oGet[ nY ]:lReadOnly:=.t.
For nX := 1 To TOTX
@ nrow, ncol BITMAP aBmps[ nY, nX ] RESOURCE "VUOTO" OF oApp:oPanel ;
SIZE BMP_H, BMP_V PIXEL ADJUST NOBORDER
ncol:=ncol+BMP_V
Next nX
@ nRow, nCol say ny OF oApp:oPanel PIXEL SIZE BMP_V,BMP_V COLOR CLR_BLACK,nRGB( 240, 232, 188 ) BORDER
nRow += BMP_H
nCol := BMP_V
Next nY
nCol:=BMP_V
For t=1 to Totx
@ nRow, nCol say t OF oApp:oPanel PIXEL SIZE BMP_H,BMP_V COLOR nRGB( 3, 56, 147 ),nRGB( 255, 255, 220 ) BORDER
nCol:=nCol+BMP_V
Next t
return nil
How I can resolve it ?
Best Regards, Saludos
Falconi Silvio
Falconi Silvio