Re: Using ColorResolutionCommand error
Started by nick@compufit at 06-09-2008 9:35. Topic has 7 replies.
|
|
06-09-2008, 9:35
|
nick@compufit
Joined on 06-09-2008
Posts 8
|
Using ColorResolutionCommand error
|
 
 
|
|
|
i have this image 1024x786 with an 96 dpi, now i just want to change the dpi 48with the same size
this is my code, i alwyas get an exception:
the code is the attachement
|
|
|
|
|
Report
|
|
|
|
06-09-2008, 9:39
|
nick@compufit
Joined on 06-09-2008
Posts 8
|
Re: Using ColorResolutionCommand error
|
 
 
|
|
|
the code: RasterImage image = scanViewer.Image; RasterSizeFlags flags = RasterSizeFlags.Resample;
ColorResolutionCommand colorResolutionCommand = new ColorResolutionCommand(); if (colorResolutionCommand != null) { colorResolutionCommand.BitsPerPixel = 48; RunCommand(colorResolutionCommand, image); }
IRasterCommand command = new SizeCommand(1024, 768, flags); if (command != null) { RunCommand(command, image); }
private void RunCommand(IRasterCommand pCommand, RasterImage pImage) { try { pCommand.Run(pImage); } catch { } }
Leadtools.RasterException was caught Message="Extended grayscale support is required" Source="Leadtools" StackTrace: bij Leadtools.RasterException.CheckErrorCode(Int32 code) bij Leadtools.ImageProcessing.RasterCommand.Run(RasterImage image) bij Leadtools.ImageProcessing.ColorResolutionCommand.Run(RasterImage image) bij Compufit.ScanTool.Scanner.RunCommand(IRasterCommand pCommand, RasterImage pImage) in C:\SourceCode\Oxygen\trunk\Compufit ScanTool\Compufit.ScanTool\Scanner.cs:regel 1985 i get the error also witht the demo (MainDemo.cs)
|
|
|
|
|
Report
|
|
|
|
06-09-2008, 10:09
|
nick@compufit
Joined on 06-09-2008
Posts 8
|
Re: Using ColorResolutionCommand error
|
 
 
|
|
|
I think i dont need the ColorResolutionCommand, but something else, but what?
the ColorResolutionCommand reduces the number of colors, i want the same numbers of colors. Just lower quality (dpi)
|
|
|
|
|
Report
|
|
|
|
06-10-2008, 9:12
|
nick@compufit
Joined on 06-09-2008
Posts 8
|
Re: Using ColorResolutionCommand error
Attachment: Naamloos.jpg
|
 
 
|
|
|
Thanks, i will try this out.
I want to accomplish something like this (from Coreldraw)
|
|
|
|
|
Report
|
|
|
|
06-11-2008, 9:46
|
Adam Boulad

Joined on 09-16-2007
Posts 406
|
Re: Using ColorResolutionCommand error
|
 
 
|
|
|
Keep in mind that the X and Y resolution values in LEADTOOLS are always in dots (pixels) per inch. This means if you want to use other units, you must convert the value. For example, if the image width is 2550 pixels and its XRes is 300 DPI, its width will be 2550/300, which is 8.5 inches. The same size in centimeters will be 8.5 * (2.54 cm/inch) which is 21.59 cm.
Adam Boulad LEADTOOLS Technical Support
|
|
|
|
|
Report
|
|
|
|
06-13-2008, 8:07
|
nick@compufit
Joined on 06-09-2008
Posts 8
|
Re: Using ColorResolutionCommand error
|
 
 
|
|
|
I think me misunderstand each other
I want this to do with the image:
orginal image: 1024*786 96pdi
changed to
new image: 1024*786 48dpi
result
same size (witdh/height), just lower quality
|
|
|
|
|
Report
|
|
|
|
06-15-2008, 10:07
|
Adam Boulad

Joined on 09-16-2007
Posts 406
|
Re: Using ColorResolutionCommand error
|
 
 
|
|
|
In LEADTOOLS, changing the DPI value has absolutely no effect on display quality. If the image is 1024*786 pixels, LEADTOOLS will display it exactly the same regardless of what DPI value it has.
If you only want to change the values of horizontal and vertical dots per inch resolutions, all you have to do is set the XResolution Property (RasterImage) and YResolution Property (RasterImage) to a different value. If you save the image in a format that supports storing DPI, the new values will be stored in the file.
Again, changing these 2 numbers has no effect on the image quality, no effect on its size in memory, and no effect on its size on disk when you save it in any format.
Adam Boulad LEADTOOLS Technical Support
|
|
|
|
|
Report
|
|
|
|
|
LEAD Support Fo... » Developer » DotNet » Re: Using ColorResolutionCommand error
|
|
Copyright LEAD Technologies, Inc. 2008
