Solved

Rotate base64 string/ gif before printing

Posted on 2014-03-12
2
888 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 75

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 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

18 Experts available now in Live!

Get 1:1 Help Now