[AccessD] Print graphics file from Access

Doug Steele dbdoug at gmail.com
Fri Sep 2 15:08:37 CDT 2011


The API for the signature capture software doesn't give any options about
output types.  But it turned out that the .Net System.Drawing namespace had
the answer. I was able to find some sample code on the web which led me to a
solution which we've implemented:

(C# code in the capture app, error handling code removed):
       // get signature as default (png format)
       System.Drawing.Bitmap BM = ctlSignature.SaveSignature("");
        // save as jpg
        BM.Save(Server.MapPath("~/sigs/" + SessionVars.EditWONum.ToString()
+ "sign.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg);

Approximately 8 hours of research, mostly off on a wild goose chase, led to
a solution consisting of two lines of code :)

Doug

On Fri, Sep 2, 2011 at 12:39 PM, Jim Lawrence <accessd at shaw.ca> wrote:

> Have you tried save the image as a GIF or PNG type file with transparency?
>
> Jim
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele
> Sent: Tuesday, August 30, 2011 9:08 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Print graphics file from Access
>
> Hello All:
>
> I have an A2003 invoicing database; when it prints an invoice, it prints a
> signature which has been captured by another app.  The signature is in a
> .jpg file.
>
> This worked fine until recently, when we changed the signature capture app.
>  It turns out that the new app is creating a transparent .jpg, and the old
> one created one with a white background.  Access won't print the
> transparent
> .jpg.  If I open a signature file in Paint, then re-save it, Paint converts
> the transparent background to white and Access is happy.  But my client
> isn't happy at the idea of doing this by hand for every invoice he prints!
>
> Does anyone know of a way that I can automatically convert a transparent
> jpg
> to white background in code, or have any other ideas to make this work?
>
> Thanks,
> Doug
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list