printer driver 4bpp problem

Hi All,
I am working on MSPLOT sample given in DDK. Its a sample plotter driver. The
problem is that it prints the color images in 4bpp (bits per pixel). I need
to enhance it. I want it to print color image in 8bpp or more. So for this
what I have to do?
Please give me some solution or idea to proceed.

thanks
abdul

shaikh abdul kareem wrote:

Hi All,
I am working on MSPLOT sample given in DDK. Its a sample plotter
driver. The problem is that it prints the color images in 4bpp (bits
per pixel). I need to enhance it. I want it to print color image in
8bpp or more. So for this what I have to do?
Please give me some solution or idea to proceed.

Check the value in pDrvHTInfo->HTBmpFormat.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,
Thanks for your reply.

I have set pDrvHTInfo->HTBmpFormat = *BMF_8BPP* and pGDIInfo->ulHTOutputFormat
= *HT_FORMAT_8BPP*.
The problem is when the DrvCopyBits gets called the contents of “XLATEOBJ
*pxlo” is
pxlo->flXlate = 1 ; //i.e XO_TRIVIAL
pxlo->cEntries = 256;

and when i trie to get the source palette using

cPal = XLATEOBJ_cGetPalette(pxlo,XO_SRCPALETTE,sizeof(SrcPal) /
sizeof(PALETTEENTRY),(ULONG
*)SrcPal);

the return value is ZERO i.e cPla = 0;
Why its behaving like this? I think it should be 256.

But when i revert back the changes that means I set the
pDrvHTInfo->HTBmpFormat = BMF_4BPP, the contents of “XLATEOBJ *pxlo” in
DrvCopyBits function is pxlo->flXlate = 2 ; //i.e XO_TABLE
pxlo->*cEntries* = 8;

and XLATEOBJ_cGetPalette function returns 8.
Do I need to change any thing else?

I did not modified any other part of the code.

Please help me in this reagard.

Thanks,
abdul.

On 12/6/06, Tim Roberts wrote:
>
> shaikh abdul kareem wrote:
> > Hi All,
> > I am working on MSPLOT sample given in DDK. Its a sample plotter
> > driver. The problem is that it prints the color images in 4bpp (bits
> > per pixel). I need to enhance it. I want it to print color image in
> > 8bpp or more. So for this what I have to do?
> > Please give me some solution or idea to proceed.
>
> Check the value in pDrvHTInfo->HTBmpFormat.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

shaikh abdul kareem wrote:

I have set pDrvHTInfo->HTBmpFormat = *BMF_8BPP* and
pGDIInfo->ulHTOutputFormat = *HT_FORMAT_8BPP*.
The problem is when the DrvCopyBits gets called the contents
of “XLATEOBJ *pxlo” is
pxlo->flXlate = 1 ; //i.e XO_TRIVIAL
pxlo->cEntries = 256;

and when i trie to get the source palette using

cPal = XLATEOBJ_cGetPalette(pxlo,XO_SRCPALETTE,sizeof(SrcPal) /
sizeof(PALETTEENTRY),(ULONG *)SrcPal);

the return value is ZERO i.e cPla = 0;
Why its behaving like this? I think it should be 256.

XO_TRIVIAL means that no translation is necessary. The source pixels
are using the same palette as the destination pixels, so there is no
translation in the XLATEOBJ. If you need to know the RGB value for a
given pixel, use the “current” palette for your surface.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,
Thanks for your last reply. It helped me to solve my problem.

I am trying to enhance the MSPlot sample. Currently MSplot supports only
4bpp image output. I Want it to make 24bpp. I have set the
pDrvHTInfo->HTBmpFormat = *BMF_24BPP* and pGDIInfo->ulHTOutputFormat =
*HT_FORMAT_24BPP*. And the GDI is giving 24 bpp halftone image. But the
problem is, for each pixel the GDI is giving 7(seven) RGB triplates, almost
all seven triplates are of same color as the pixel original color. and some
times for one pixel it gives 8 RGB triplates instead of 7, But 7 is minimum
triplates of each pixel. Why its giving 7 or more RGB triplates for one
pixel? As i am working on 4bpp code of MSplot, i did not change any other
variables other then above mention two. Do I need to set any other data for
24bpp halftone?

Please help me.
Thanks,
Abdul

On 12/7/06, Tim Roberts wrote:
>
> shaikh abdul kareem wrote:
> >
> > I have set pDrvHTInfo->HTBmpFormat = BMF_8BPP and
> > pGDIInfo->ulHTOutputFormat = HT_FORMAT_8BPP.
> > The problem is when the DrvCopyBits gets called the contents
> > of “XLATEOBJ *pxlo” is
> > pxlo->flXlate = 1 ; //i.e XO_TRIVIAL
> > pxlo->cEntries = 256;
> >
> > and when i trie to get the source palette using
> >
> > cPal = XLATEOBJ_cGetPalette(pxlo,XO_SRCPALETTE,sizeof(SrcPal) /
> > sizeof(PALETTEENTRY),(ULONG *)SrcPal);
> >
> > the return value is ZERO i.e cPla = 0;
> > Why its behaving like this? I think it should be 256.
>
> XO_TRIVIAL means that no translation is necessary. The source pixels
> are using the same palette as the destination pixels, so there is no
> translation in the XLATEOBJ. If you need to know the RGB value for a
> given pixel, use the “current” palette for your surface.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

shaikh abdul kareem wrote:

I am trying to enhance the MSPlot sample. Currently MSplot supports
only 4bpp image output. I Want it to make 24bpp. I have set the
pDrvHTInfo->HTBmpFormat = *BMF_24BPP* and pGDIInfo->ulHTOutputFormat =
*HT_FORMAT_24BPP*. And the GDI is giving 24 bpp halftone image. But
the problem is, for each pixel the GDI is giving 7(seven) RGB
triplates, almost all seven triplates are of same color as the pixel
original color. and some times for one pixel it gives 8 RGB triplates
instead of 7, But 7 is minimum triplates of each pixel. Why its giving
7 or more RGB triplates for one pixel? As i am working on 4bpp code of
MSplot, i did not change any other variables other then above mention
two. Do I need to set any other data for 24bpp halftone?

I admit that I know little about the plotter-specific parts of the GDI
interface. How are you getting 7 or 8 RGB values for each pixel?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.