bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Aug 12, 2020 2:25 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Jun 25, 2020 10:45 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 392
Location: Republica Dominicana
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 1317 times ]

_________________
Nolberto Paulino
Regards
Top
 Profile  
 
PostPosted: Fri Jun 26, 2020 6:06 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4149
Location: Boise, Idaho USA
The source in _DCXBROW.PRG that draws the bitmap looks like this:
Code:
    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.


Top
 Profile  
 
PostPosted: Fri Jun 26, 2020 7:38 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 392
Location: Republica Dominicana
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:
    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


Top
 Profile  
 
PostPosted: Fri Jun 26, 2020 11:32 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4149
Location: Boise, Idaho USA
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.


Top
 Profile  
 
PostPosted: Wed Jul 15, 2020 5:22 pm 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 392
Location: Republica Dominicana
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 83 times

_________________
Nolberto Paulino
Regards
Top
 Profile  
 
PostPosted: Wed Jul 15, 2020 7:32 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1189
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:
   // 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.
Attachment:
File comment: pure Xbase++ Code
link with /PM:PM

BMP_DRAW4.ZIP [20.25 KiB]
Downloaded 60 times

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
PostPosted: Fri Jul 17, 2020 6:42 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4149
Location: Boise, Idaho USA
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:
Attachment:
Capture.JPG
Capture.JPG [ 47.09 KiB | Viewed 640 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 53 times

_________________
The eXpress train is coming - and it has more cars.
Top
 Profile  
 
PostPosted: Fri Jul 17, 2020 7:29 pm 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 392
Location: Republica Dominicana
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:
Attachment:
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


Top
 Profile  
 
PostPosted: Fri Jul 17, 2020 9:57 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1189
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:
#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/windows/win32/api/wingdi/nf-wingdi-stretchblt

Scaling an Image
https://docs.microsoft.com/en-us/windows/win32/gdi/scaling-an-image
Quote:
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:
#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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group