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

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#1 Post 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.
Attachments
eXpress.jpg
eXpress.jpg (73.29 KiB) Viewed 11729 times
Nolberto Paulino
Regards

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

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

#2 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#3 Post 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.
Nolberto Paulino
Regards

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

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

#4 Post by rdonnay »

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

I will work on this for you.
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#5 Post 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.
Attachments
eXpress.rar
(1.16 MiB) Downloaded 571 times
Nolberto Paulino
Regards

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

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

#6 Post 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 568 times
greetings by OHR
Jimmy

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

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

#7 Post 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 11052 times
Download _DCXBROW.PRG and copy it to \exp20\source\dclipx.
Run BUILD20.BAT or BUILD19_SL1.BAT to rebuild DCLIPX.DLL
Attachments
_dcxbrow.zip
(53.63 KiB) Downloaded 546 times
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#8 Post 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
Nolberto Paulino
Regards

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

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

#9 Post 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:
greetings by OHR
Jimmy

Post Reply