Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 23, 2008 6:10:30 PM(UTC)

ssskkk  
ssskkk

Groups: Registered
Posts: 74


hello,

My application is a windows based application using c#.net 2008(winforms) and framework is 3.5  and also use Leadtools version(16). In my application,

i want to display images in printpreview.it is workig and but the not display in print preview.the code i wrote for,

try

{

_printPage = 1;

if (_printDocument != null)

{

PrintPreviewDialog dlg = new PrintPreviewDialog();

dlg.Icon = Icon;

foreach (Control i in dlg.Controls)

{

PrintPreviewControl c = i as PrintPreviewControl;

if (c != null)

{

c.StartPage = rstrToolsimageViewer.Image.Page-1 ;

break;

}

}

dlg.Document = _printDocument;

dlg.ShowDialog(this);

}

}

catch { }

regards,

Dillep

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, December 24, 2008 1:40:22 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Dillep,

Do you mean that the image doesn't appear in the Preview dialog?

To resolve the problem, please try the following code:
+-----------------+
PrintDocument _printDocument;

private void InitClass( )
{
...
_printDocument = new PrintDocument();
_printDocument.PrintPage += new PrintPageEventHandler(_printDocument_PrintPage);
...
}
private void _printDocument_PrintPage(object sender, PrintPageEventArgs e)
{
RasterImage image = rasterImageViewer1.Image;

RasterImagePrinter printer = new RasterImagePrinter();
printer.UseDpi = rasterImageViewer1.UseDpi;
printer.Print(image, image.Page, e);
}

private void _menuItemFilePrintPreview_Click(object sender, EventArgs e)
{
if(_printDocument != null)
{
try
{
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Document = _printDocument;
dlg.ShowDialog(this);
}
catch { }
}
}
+-----------------+

Please try the same issue using the above code and let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.053 seconds.