Displaying a System.Drawing.Image

Discussions about document viewing.
Post Reply
EDMgroup
Posts: 2
Joined: Thu Jan 12, 2012 7:04 pm

Displaying a System.Drawing.Image

Post by EDMgroup » Thu Jan 12, 2012 7:10 pm

Hi,

I have had a search to see if anyone had encountered this before but could not find anything on the forum.

I am currently using GDPicture.net 6.6 in a VS2005 C# project and have a toolkit that I need to integrate that is returning a System.Drawing.Image object that I need to display via GDPicture.net. Unfortunately I can't see a way of doing it despite having a search elsewhere. Is this possible and how do I do it?

Many thanks for your help

EDMgroup
Posts: 2
Joined: Thu Jan 12, 2012 7:04 pm

Re: Displaying a System.Drawing.Image

Post by EDMgroup » Fri Jan 13, 2012 11:53 am

It's amazing how a nights sleep can make you think a bit clearer. It think it was a case of not being able to see the wood for the trees and the answer was staring me in the face all the time. All I needed to do was cast the image to a bitmap and it worked perfectly:

this.gdvImage.DisplayFromBitmap((Bitmap)imagepage.ItemFront.Image);
where imagepage.ItemFront.Image is a system.drawing.image

If anyone can think of a better or safer way of getting this to work please let me know.

mcattle
Posts: 1
Joined: Fri Dec 14, 2012 7:48 pm

Re: Displaying a System.Drawing.Image

Post by mcattle » Fri Dec 14, 2012 7:54 pm

The trouble with casting it to a bitmap first is that you lose information from a multi-page image (Tiff or Gif, for example), and you only get the first page.

I'm looking for a solution as well. My current line of thinking is that I can get a pointer to the image's location in memory and then call gdvImage.DisplayFromMemory()

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests