Solved

Rotate base64 string/ gif before printing

Posted on 2014-03-12
2
988 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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