Solved

Rotate base64 string/ gif before printing

Posted on 2014-03-12
2
870 Views
Last Modified: 2014-03-12
I'm using the UPS developer api to print shipping labels.
The label is returned in a Base64String.

I convert the Base64 to an image and then print the image with print document.

The image is sideways and needs to be rotated clockwise.

How should I go about doing that?
0
Comment
Question by:JRockFL
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39924950
Use the RotateFlip method of the Image class:

e.g.

byte[] imgData = Convert.FromBase64String("the base-64 string");
System.IO.MemoryStream ms = new System.IO.MemoryStream(imgData);

using (System.Drawing.Image img = System.Drawing.Image.FromStream(ms))
{
    img.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);

    // print the image
}

Open in new window

0
 
LVL 8

Author Comment

by:JRockFL
ID: 39924964
Perfect! That worked. Now I can stop messing around.
Thank you.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
LINQ question 7 21
Refresh Datagridview from another form 1 26
XML & .net 5 18
C# TextBox 11 0
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now