Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
amf  
#1 Posted : Sunday, October 1, 2006 7:49:52 AM(UTC)
amf

Rank: Member

Groups: Member
Joined: 10/1/2006(UTC)
Posts: 10

I have an application using the bitmap viewer. Works fine, does zoom, scroll, all those things. Looks a lot like the demo. Working with an image that's a fax with asymmetrical resolutions (it's different in the X and Y directions). Don't know if that tidbit matters, but it might.

I have a customer who has trouble seeing the screen at normal display resolution (96 DPI), so he changes it to 120 DPI (Control Panel/Display/Settings tab/Advanced button/General tab). The bitmap viewer tries to display the image, but gets strange vertical bars on the right-half of it (if it even displays and doesn't crash when the bitmap viewer tries to draw the image). If I get the screwed-up looking viewer to open, then I can't close the window with the bitmap viewer without the application crashing the entire application (actually, it's an MDI application and the first viewer to open works fine, but the second one opened has the problems).

I just ran it under the debugger to see where it's freaking out and the last four calls are (all in the GraphicsMill namespace):

Code:
WinControls.BitmapViewer.OnPaint
Drawing.GdiGraphics.DrawImage
Drawing.GdiGraphics._DrawImage
Bitmap._Draw

Application works fine at 96 DPI on the same workstation, has none of the problems and doesn't crash, so pretty comfortable that the application is correct working properly.

Send help. Thanks.

Edited by user Wednesday, December 19, 2007 1:42:18 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Sunday, October 1, 2006 3:40:31 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

Thanks for your post.

I have tried to change resoultion to 120DPI and load TIFF fax with different horizontal/verticlal resolutions. It works. Could you submit case with the problem file?

Edited by user Thursday, May 22, 2008 9:54:24 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Wayne  
#3 Posted : Monday, November 13, 2006 6:53:57 AM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

I am having a similar problem with the Bitmap Viewer and it seems to be with group 3 faxes that have different horiz and vertial DPI. For example an X DPI of 200 and Y DPI of 100. The faxes we get with both an X and Y DPI of 300 seem to be working ok. The crash we get occurs when you try to do a Transform on the tif images with a different X and Y DPI.

amf  
#4 Posted : Monday, November 13, 2006 8:50:37 AM(UTC)
amf

Rank: Member

Groups: Member
Joined: 10/1/2006(UTC)
Posts: 10

The solution I was given was to change ZoomQuality from High to Low and that the fix would appear in .Net 4.0, due soon.

On the other hand, I was able to also do this to rotate a fax image so that it shows up the correct orientation and then change the resolution and save as a PNG:

Code:
                        Dim bitmap As New Aurigma.GraphicsMill.Bitmap
                        ' ... acquire bitmap ...
                        ' see if needs to be rotated to better fit a long page.
                        Dim height As Integer = bitmap.Height
                        Dim width As Integer = bitmap.Width
                        Dim sizeX As Single = (width / bitmap.HorizontalResolution)
                        Dim sizeY As Single = (height / bitmap.VerticalResolution)
                        Dim needsRotate = ((sizeY < sizeX) And (sizeX > 7.5))
                        If needsRotate Then
                            Dim h As Single = bitmap.HorizontalResolution
                            Dim v As Single = bitmap.VerticalResolution
                            bitmap.Transforms.RotateAndFlip(RotateFlipType.Rotate270FlipNone)
                            bitmap.VerticalResolution = h
                            bitmap.HorizontalResolution = v
                            Dim temp As Single = sizeX
                            sizeX = sizeY
                            sizeY = temp
                        End If

                        ' now convert to an image format we can easily insert into a word doc
                        Dim maxResolution = Math.Max(bitmap.HorizontalResolution, bitmap.VerticalResolution)
                        bitmap.HorizontalResolution = maxResolution
                        bitmap.VerticalResolution = maxResolution
                        bitmap.Transforms.Resize(sizeX * maxResolution, sizeY * maxResolution, Aurigma.GraphicsMill.Transforms.ResizeMode.Resize, InterpolationMode.HighQuality)

                        Dim strm As New System.IO.MemoryStream
                        bitmap.Save(strm, New PngEncoderOptions(False))
                        finalBitmap = New System.Drawing.Bitmap(strm)
                        finalBitmap.SetResolution(maxResolution, maxResolution)
                        bitmap.Dispose()

Perhaps something in the above will help.

Edited by user Wednesday, December 19, 2007 1:44:12 PM(UTC)  | Reason: Not specified

Wayne  
#5 Posted : Monday, November 13, 2006 12:02:21 PM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

Thanks for the reply amf. I will see what I can use with your code.

After some more research I have found that the problem is not necessarily with a TIF that has different X and Y DPI. Although I think this is part of the problem. It looks like what causes the crash is a weird fax page with like an X size of 518 and Y size of 1728. Normally our Group 3's have an X size of 1047 and Y of 1728. So when I have the zoom mode set to show height and it is sideways it seems to be so off scale and Zoomed in it will eventually crash after 1 or more transforms.

I did change the Zoom mode to Best fit to get the image to always fit in the BitmapViewer and so far I have not crashed. Zoom Quality may also be a factor since I had it on High in the BitmapViewer. I need to do some more testing but I think I have an idea now of what is crashing the BitmapViewer.

I sent a ticket into support today. I am waiting to see what they have to say.

Dmitry  
#6 Posted : Monday, November 13, 2006 7:31:04 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Quote:
Wayne (11/13/2006)

After some more research I have found that the problem is not necessarily with a TIF that has different X and Y DPI. Although I think this is part of the problem. It looks like what causes the crash is a weird fax page with like an X size of 518 and Y size of 1728. Normally our Group 3's have an X size of 1047 and Y of 1728. So when I have the zoom mode set to show height and it is sideways it seems to be so off scale and Zoomed in it will eventually crash after 1 or more transforms.

Hello,

Have you tried to use LowQuality interpolation mode? It seems it is the same problem with "scale to gray" algorithm. This fix will be available with the next release.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Wayne  
#7 Posted : Tuesday, November 14, 2006 6:19:19 AM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

Dmitry,

Is the interpolation mode only used when I do a Resize Transform?

Dmitry  
#8 Posted : Tuesday, November 14, 2006 7:32:54 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

Please, use Resize.InterpolationMode = InterpolationMode.LowQuality and BitmapViewer.ZoomQuality = ZoomQuality.Low as workaround.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Wayne  
#9 Posted : Wednesday, November 15, 2006 1:46:08 AM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

Dmitry,

I will have to leave my zoom quality at the very least at Medium because my program is now in production and we have to make business decisions based on the images we get. We also need to keep our images at the best quality as possible because these get written to our imaging repository for storage and we need to refer back to these documents.

My current work around is to default the image to Best Fit in the Bitmap Viewer. So far this seems to working. Of course if they zoom in on a image I mentioned above it will crash the program.

Any idea when the next release will be out?

amf  
#10 Posted : Wednesday, November 15, 2006 10:04:27 AM(UTC)
amf

Rank: Member

Groups: Member
Joined: 10/1/2006(UTC)
Posts: 10

Wayne,

Have you considered changing transforming the image to an 8bpp image with similar resolution in X and Y before loading it into the viewer? Or even a 32bpp image? You might get the results you want that way (see code I posted for how to do this successfully).

-- Andy.

Dmitry  
#11 Posted : Wednesday, November 15, 2006 7:31:12 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Quote:
Wayne (11/15/2006)

Dmitry,

Any idea when the next release will be out?

The next version will be released this year. Beta version of new Graphics Mill for .NET will be available soon. You can get this version if you subscribe to beta testing.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Dmitry  
#12 Posted : Wednesday, November 15, 2006 7:33:55 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Quote:
amf (11/15/2006)

Wayne,

Have you considered changing transforming the image to an 8bpp image with similar resolution in X and Y before loading it into the viewer? Or even a 32bpp image? You might get the results you want that way (see code I posted for how to do this successfully).

-- Andy.

This workarond will help you. If you convert your images to non-indexed (grayscale or rgb) format, the problem goes out.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Wayne  
#13 Posted : Thursday, November 16, 2006 3:30:19 AM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

Andy and Dmitry,

Can you explain what an 8bpp or 32bpp image is? Is that the pixel format? And if so what is the difference between indexed and non-indexed?

What difference in image quality does it cause?

Thanks

amf  
#14 Posted : Thursday, November 16, 2006 4:10:12 AM(UTC)
amf

Rank: Member

Groups: Member
Joined: 10/1/2006(UTC)
Posts: 10

I'll start and let Dmitry pick up where I leave things out:

In general, faxes have one bit per pixel (1bpp). Basically in a fax, a pixel is either on (1) or off (0). Greyscale images are done with multiple bits per pixel, usually 8 (hence, 8bpp); color uses more (16, 24, 32 are common).

GraphicsMill has a bug dealing with 1bpp in transformations at high quality. So if you want to do those transformations, you can first convert it to greyscale (8bpp) or another format entirely (from TIF to, say, PNG) and then do the transformations you want. Because you're increasing to a higher number of bits per pixel, the conversion will neither improve nor degrade your image quality. It will, however, increase the amount of memory required to manage the converted image. On the other hand, Graphics Mill won't crash when you do the transformations on the converted image.

Hope this helps. -- Andy.

Wayne  
#15 Posted : Thursday, November 16, 2006 6:44:52 AM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

Andy,

Great, thanks for explaining that to me. It gives me some things to think about. I am not sure if I want to store a greyscale version out to our Image repository or if it matters. I'll play around with it and see what I can come up with. I might instantiate a greyscale copy in the BitmapViewer for the user to look at but store the original to our repository.

amf  
#16 Posted : Thursday, November 16, 2006 7:06:11 AM(UTC)
amf

Rank: Member

Groups: Member
Joined: 10/1/2006(UTC)
Posts: 10

[quoteI might instantiate a greyscale copy in the BitmapViewer for the user to look at but store the original to our repository.

That is the best plan: store the smallest sized image and manipulate internally as greyscale to ensure that you don't crash. Good luck.

Dmitry  
#17 Posted : Thursday, November 16, 2006 7:10:15 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Quote:
amf (11/16/2006)

I'll start and let Dmitry pick up where I leave things out:

In general, faxes have one bit per pixel (1bpp). Basically in a fax, a pixel is either on (1) or off (0). Greyscale images are done with multiple bits per pixel, usually 8 (hence, 8bpp); color uses more (16, 24, 32 are common).

GraphicsMill has a bug dealing with 1bpp in transformations at high quality. So if you want to do those transformations, you can first convert it to greyscale (8bpp) or another format entirely (from TIF to, say, PNG) and then do the transformations you want. Because you're increasing to a higher number of bits per pixel, the conversion will neither improve nor degrade your image quality. It will, however, increase the amount of memory required to manage the converted image. On the other hand, Graphics Mill won't crash when you do the transformations on the converted image.

Hope this helps. -- Andy.

Hello Andy,

Thanks for your answer. Wayne, you can read more information in the article "Color Depth".

Edited by user Wednesday, October 29, 2008 1:50:11 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Wayne  
#18 Posted : Friday, March 2, 2007 6:32:01 AM(UTC)
Wayne

Rank: Member

Groups: Member
Joined: 6/14/2006(UTC)
Posts: 10

Does Graphics Mill for .NET version 4 fix this problem?
Dmitry  
#19 Posted : Sunday, March 4, 2007 12:57:04 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

This problem is resolved. You can download trial version and try it out.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.