Page 1 of 1

I have a problem using BITMAP with DCA CELLITEM in DC BROWSE

Posted: Thu Jun 25, 2020 10:45 am
by digitsoft
Hello Roger
I have a problem using BITMAP with DCADDCELLITEM in DCBROWSE

Image Distorted in DCBROWSE, could you help me solve this problem.

I attach an example

Thank you.

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Fri Jun 26, 2020 6:06 am
by rdonnay
The source in _DCXBROW.PRG that draws the bitmap looks like this:

Code: Select all

    aSource := {0,0,oBitmap:xSize,oBitmap:ySize}

    aTarget := { nStartCol, nStartRow, nEndCol, nEndRow }

    ::oBitmap:draw( oPS, aTarget, aSource, GRA_BLT_ROP_SRCCOPY,, XBP_STATE_NORMAL )
I suggest that you experiment with some options of XbpBitmap():draw() to see if it makes an improvement.

You will need to modify _DCXBROW.PRG and rebuild DCLIPX.DLL by running BUILD20.BAT.

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Fri Jun 26, 2020 7:38 am
by digitsoft
Thanks Roger for your help
On Line 5119 this code is written and the bitmap does not look good

IF lIcon
aTarget: = {nStartCol, nStartRow, nEndCol, nEndRow}
:: oIcon: Draw (oPS, aTarget, XBP_STATE_NORMAL)
ELSEIF lBitmap

aSource: = {0,0, oBitmap: xSize, oBitmap: ySize}
aTarget: = {nStartCol, nStartRow, nEndCol, nEndRow}
:: oBitmap: draw (oPS, aTarget, aSource, GRA_BLT_ROP_SRCCOPY ,, XBP_STATE_NORMAL)

ELSEIF Valtype (cCaption) == 'C'
GraCaptionStr (oPS, {nStartCol, nStartRow}, {nEndCol, nEndRow}, cCaption, nAlign)
ENDIF



rdonnay wrote:The source in _DCXBROW.PRG that draws the bitmap looks like this:

Code: Select all

    aSource := {0,0,oBitmap:xSize,oBitmap:ySize}

    aTarget := { nStartCol, nStartRow, nEndCol, nEndRow }

    ::oBitmap:draw( oPS, aTarget, aSource, GRA_BLT_ROP_SRCCOPY,, XBP_STATE_NORMAL )
I suggest that you experiment with some options of XbpBitmap():draw() to see if it makes an improvement.

You will need to modify _DCXBROW.PRG and rebuild DCLIPX.DLL by running BUILD20.BAT.

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Fri Jun 26, 2020 11:32 am
by rdonnay
Give me a small sample program and also your .BMP file.

I will work on this for you.

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Wed Jul 15, 2020 5:22 pm
by digitsoft
Hello Roger
Attached is compressed eXpress.rar with the example.

On Line 28 is this code cPath: = "C:\Win\nom\sql\GCEFEI\eXpress\"
just put the path where the example folder is with the bitmap



rdonnay wrote:Give me a small sample program and also your .BMP file.

I will work on this for you.

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Wed Jul 15, 2020 7:32 pm
by Auge_Ohr
hi,

when reduce Bitmap Size e.g. for Thumbs it never look good.

to make it little better you can try Tip from Diego

Code: Select all

   // Tip with 4 ???
   //
   oBMP:Draw(oPS,{0,0,aXbpSize[1],aXbpSize[2]},,, 4 )
it is not document but have a look at attached Sample if it make a Difference for you.
BMP_DRAW4.ZIP
pure Xbase++ Code
link with /PM:PM
(20.25 KiB) Downloaded 571 times

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Fri Jul 17, 2020 6:42 am
by rdonnay
The tip from Diego appears to work.
The number 4 for bit-blitting is not defined in GRA.CH, so I was not aware that there were other options.

I have made this change in _DCXBROW.PRG and tested other applications to make sure there was no regression.
Here is the new result:
Capture.JPG
Capture.JPG (47.09 KiB) Viewed 11079 times
Download _DCXBROW.PRG and copy it to \exp20\source\dclipx.
Run BUILD20.BAT or BUILD19_SL1.BAT to rebuild DCLIPX.DLL

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Fri Jul 17, 2020 7:29 pm
by digitsoft
Thanks Roger
rdonnay wrote:The tip from Diego appears to work.
The number 4 for bit-blitting is not defined in GRA.CH, so I was not aware that there were other options.

I have made this change in _DCXBROW.PRG and tested other applications to make sure there was no regression.
Here is the new result:
Capture.JPG
Download _DCXBROW.PRG and copy it to \exp20\source\dclipx.
Run BUILD20.BAT or BUILD19_SL1.BAT to rebuild DCLIPX.DLL

Re: I have a problem using BITMAP with DCA CELLITEM in DC BR

Posted: Fri Jul 17, 2020 9:57 pm
by Auge_Ohr
hi
rdonnay wrote:The tip from Diego appears to work.
The number 4 for bit-blitting is not defined in GRA.CH, so I was not aware that there were other options.
Xbase++ have 3 x Constant

Code: Select all

#define  GRA_BLT_BBO_AND                1
#define  GRA_BLT_BBO_OR                 2
#define  GRA_BLT_BBO_IGNORE             3
oBitmap:Draw IHMO use Windows StretchBlt function
https://docs.microsoft.com/en-us/window ... stretchblt

Scaling an Image
https://docs.microsoft.com/en-us/window ... g-an-image
Stretch mode Method
BLACKONWHITE Performs a logical AND operation on the color data for the eliminated pixels and the color data for the remaining pixels.
WHITEONBLACK Performs a logical OR operation on the color data for the eliminated pixels and the color data for the remaining pixels.
COLORONCOLOR Eliminates the color data of the deleted pixels completely.
HALFTONE Approximates the original (source) color data in the destination.

Code: Select all

#define BLACKONWHITE 1
#define WHITEONBLACK 2
#define COLORONCOLOR 3
#define HALFTONE 4
so there are 4 #define but Alaska just give us 3 #define

p.s. i donĀ“t understand why Alaska use "own" Constant instead of "given" by Windows :roll: