DC_BitmapDraw()

This forum is for eXpress++ general support.
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_BitmapDraw()

#11 Post by rdonnay »

DCSTATIC ... does not have :autoScale property, only :autoSize and they do not behave the sameway
That was a typo. You are correct about that. :autoSize should work for you.

If you are wanting the static to stay at the same size and scale down the bitmap to fit the static then you will need to use the :draw() method of the XbpBitmap() class to draw the bitmap into the presentation space of the static.
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DC_BitmapDraw()

#12 Post by unixkd »

Yes thant is what I want.

I will appreciate if you can modify the sample program you gave earlier to accomplish this.

Regards.

Joe.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_BitmapDraw()

#13 Post by rdonnay »

I will appreciate if you can modify the sample program you gave earlier to accomplish this.

Code: Select all

FUNCTION RunAnimation(oStatic,oBitmap)

LOCAL oPS := oStatic:lockPs(), aTarget, nAspect, nXSize, nYSize

nXSize := oStatic:currentSize()[1]
nYSize := oStatic:currentSize()[2]

BMPDB->(dbGoTop())
DO WHILE !BMPDB->(Eof())
  oBitmap:setBuffer(BMPDB->bitmap,XBPBMP_FORMAT_WIN3X)
  aTarget := { 0, 0, nXSize, nYSize }
  nAspect    := oBitmap:xSize / oBitmap:ySize
  IF nAspect > aTarget[3] / aTarget[4]
    aTarget[4] := aTarget[3] / nAspect
  ELSE
    aTarget[3] := aTarget[4] * nAspect
  ENDIF
  oBitmap:draw( oPS, aTarget )
  BMPDB->(dbSkip())
  Sleep(5)
ENDDO

oStatic:unlockPS()

RETURN nil
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DC_BitmapDraw()

#14 Post by unixkd »

Roger.

Many thanks.

Joe

Post Reply