Guys:
Is there a way to know how many pixels a JPG is ? For example 278 pixels wide and 350 high. Thank you.
Finding out image size.
Re: Finding out image size.
Imagesize and Display :
...
LOCAL oBMP1
// Get Window-Screen-Size
LOCAL nWidth := GetSysMetrics(0)
LOCAL nHeight := GetSysMetrics(1)
...
...
// Your Image :
DEFINE IMAGE oBMP1 FILENAME c_path + "\System\BACKGRD.JPG"
Msgalert( oBMP1:nWidth() )
Msgalert( oBMP1:nHeight() )
// Use and adjust Image to Window-Size ( Background )
...
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( DRAWBITMAP( hdc, oBMP1:hbitmap, 0, 0, nWidth, nHeight ) )
RETURN NIL
Best Regards
Uwe![Laughing :lol:](./images/smilies/icon_lol.gif)
...
LOCAL oBMP1
// Get Window-Screen-Size
LOCAL nWidth := GetSysMetrics(0)
LOCAL nHeight := GetSysMetrics(1)
...
...
// Your Image :
DEFINE IMAGE oBMP1 FILENAME c_path + "\System\BACKGRD.JPG"
Msgalert( oBMP1:nWidth() )
Msgalert( oBMP1:nHeight() )
// Use and adjust Image to Window-Size ( Background )
...
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( DRAWBITMAP( hdc, oBMP1:hbitmap, 0, 0, nWidth, nHeight ) )
RETURN NIL
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: Finding out image size.
Uwe:
Thank you for your help. I really appreciate it.
I'm trying to make the oWnd window the exact size of the JPG. Here's the code:
The resulting window is not the exact image size, how can I do this ? Thanks in advance.
Gustavo
Thank you for your help. I really appreciate it.
![Cool 8)](./images/smilies/icon_cool.gif)
Code: Select all | Expand
DEFINE WINDOW oWnd FROM 00,00 TO NO_OF_ROWS - INT(oBMP1:nHeight() / 15.18987341772151898 ), ;
NO_OF_COLS - INT(oBMP1:nWidth() / 7.933884297520661157)
// Use and adjust Image to Window-Size ( Background )
ACTIVATE WINDOW oWnd NORMAL ;
ON PAINT ( DRAWBITMAP( hdc, oBMP1:hbitmap, 0, 0, oBmp1:nWidth(), oBmp1:nHeight() ) )
The resulting window is not the exact image size, how can I do this ? Thanks in advance.
Gustavo
Re: Finding out image size.
Hello Gustavo,
it is the other direction : Adjust Window to a given Image-Size :
![Image](http://www.pflegeplus.com/pictures/wndsize.jpg)
...
...
DEFINE WINDOW oWnd TITLE "SButton-Tools"
DEFINE IMAGE oBMP1 FILENAME c_path + "\System\Fantasy6.JPG"
...
...
ACTIVATE WINDOW oWnd ;
ON PAINT ( DRAWBITMAP( hdc, oBMP1:hbitmap, 0, 0 ) ,;
oWnd:Move( 50, 50, oBMP1:nWidth, oBMP1:nHeight, .T. ) )
// moves the Window to a given Position adjusted to the Image-Size
RETURN ( NIL )
Best regards
Uwe![Laughing :lol:](./images/smilies/icon_lol.gif)
it is the other direction : Adjust Window to a given Image-Size :
![Image](http://www.pflegeplus.com/pictures/wndsize.jpg)
...
...
DEFINE WINDOW oWnd TITLE "SButton-Tools"
DEFINE IMAGE oBMP1 FILENAME c_path + "\System\Fantasy6.JPG"
...
...
ACTIVATE WINDOW oWnd ;
ON PAINT ( DRAWBITMAP( hdc, oBMP1:hbitmap, 0, 0 ) ,;
oWnd:Move( 50, 50, oBMP1:nWidth, oBMP1:nHeight, .T. ) )
// moves the Window to a given Position adjusted to the Image-Size
RETURN ( NIL )
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.