DC of the window

Post Reply
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

DC of the window

Post by Natter »

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 ?
User avatar
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

Post by Antonio Linares »

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 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: DC of the window

Post by Natter »

Yes !
User avatar
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

Post by Antonio Linares »

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 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: DC of the window

Post by Natter »

just paint them on different locations

just to paint them from the ON PAINT of the window
User avatar
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

Post by Antonio Linares »

oWnd:bPainted := { || oWnd:DrawImage( cPngFile, aRect )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: DC of the window

Post by Natter »

Method oWnd:DrawImage( cPngFile, aRect ) works. Is it possible to read from bitmap not all the picture, but only the required fragment ?
User avatar
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

Post by Antonio Linares »

Dear Yuri,

> but only the required fragment ?

A rectangular portion of it ?

what required fragment ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: DC of the window

Post by Natter »

There is a picture file of 1920x1080. For example, I need a rectangular fragment {900,500,1000,600}
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: DC of the window

Post by nageswaragunupudi »

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
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: DC of the window

Post by Natter »

Yes, this is what we need.Thanks !
Post Reply