DC of the window
DC of the window
Hi,
There are several .png files. I need to get the DC of each of these files and put it in a specific position on my application window. How can I do this ?
There are several .png files. I need to get the DC of each of these files and put it in a specific position on my application window. How can I do this ?
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: DC of the window
Dear Yuri,
A DC (device context) belongs to a window, not to a PNG file.
I guess that you have several PNG files and you want to paint them on a window, is this correct ?
A DC (device context) belongs to a window, not to a PNG file.
I guess that you have several PNG files and you want to paint them on a window, is this correct ?
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: DC of the window
Is it an animation ? I mean, do you want to paint them one after another, or just paint them on different locations ?
Do you need them as controls or just to paint them from the ON PAINT of the window ?
Do you need them as controls or just to paint them from the ON PAINT of the window ?
Re: DC of the window
just paint them on different locations
just to paint them from the ON PAINT of the window
just to paint them from the ON PAINT of the window
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: DC of the window
Method oWnd:DrawImage( cPngFile, aRect ) works. Is it possible to read from bitmap not all the picture, but only the required fragment ?
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: DC of the window
Dear Yuri,
> but only the required fragment ?
A rectangular portion of it ?
what required fragment ?
> but only the required fragment ?
A rectangular portion of it ?
what required fragment ?
Re: DC of the window
There is a picture file of 1920x1080. For example, I need a rectangular fragment {900,500,1000,600}
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: DC of the window
Natter wrote:There is a picture file of 1920x1080. For example, I need a rectangular fragment {900,500,1000,600}
Use this function:
Code: Select all | Expand
function FW_TransformBitmap( hBmp, [aCrop], [nZoom], [nRotate], [nBkClr] )
Example usage:
Code: Select all | Expand
hBmp := oWnd:ReadImage( cPngFile )[ 1 ]
hCropBmp := FW_TransformBitmap( hBmp, aCropRect )
DeleteObject( hBmp )
oWnd:DrawImage( hCropBmp, aRect )`
DeleteObject( hCropBmp )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India