images not clear
images not clear
images not clear
images not clear
images not clear
images not clear images not clear images not clear images not clear images not clear images not clear images not clear images not clear
images not clear images not clear
images not clear
Go Back  Xtreme Visual Basic Talk > > > images not clear


Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2013, 11:14 AM
_Nikkiz_ _Nikkiz_ is offline
Newcomer
 
Join Date: May 2013
Posts: 4
Default images not clear


Printing .png images from my application and they are not coming out clear at all. When I print them through a program like gimp though, they come out fine. My code is below, not sure what I'm doing wrong. Any suggestions?

Code:
Private Sub btnrequest_Click(sender As System.Object, e As System.EventArgs) Handles btnrequest.Click
Dim image1 as Image
image1 = Image.FromFile("C:\Users\n.cowan\Desktop\4650 Horizontal Slider\4650_HS_LowE_366_Argon_No Grids_ES.png")

        theList.Add(image1)
        Me.PrintDocument(theList, False, 1, False)
        'End If

    End Sub
   
    Public Sub PrintDocument(ByVal Listtobeprinted As List(Of Image), ByVal UseDefaultSettings As Boolean, ByVal NumberOfCopies As Integer, ByVal Landscape As Boolean)
        
            Me.Listtobeprinted = ListtobePrinted

            Dim prn As New Printing.PrintDocument
            Using (prn)


                prn.PrinterSettings = prn.DefaultPageSettings.PrinterSettings
                'prn.DefaultPageSettings.Landscape = Landscape
                prn.DefaultPageSettings.PrinterResolution.Kind = Printing.PrinterResolutionKind.High
                prn.PrinterSettings.Copies = NumberOfCopies

                AddHandler prn.PrintPage, _
                   AddressOf Me.PrintPageHandler
                Try
                    prn.Print()
                Catch ex As Exception
                    MessageBox.Show("Printer error! " & ex.ToString)
                End Try

                RemoveHandler prn.PrintPage, _
                   AddressOf Me.PrintPageHandler
            End Using

    End Sub

    Private numberofpagesprinted As Integer = 0
    Private Sub PrintPageHandler(ByVal sender As Object, _
         ByVal args As Printing.PrintPageEventArgs)
        Dim Column3_X As Integer = 0
        Dim Row6_Y As Integer = 10
        Dim rect As Rectangle = New Rectangle(Column3_X, Row6_Y, 390, 680)
        args.Graphics.DrawImageUnscaledAndClipped(Me.Listtobeprinted.Item(numberofpagesprinted), rect)
        numberofpagesprinted = numberofpagesprinted + 1
        If Me.Listtobeprinted.Count = numberofpagesprinted Then
            args.HasMorePages = False
        Else
            args.HasMorePages = True
        End If
    End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
images not clear
images not clear
images not clear images not clear
images not clear
images not clear
images not clear images not clear images not clear images not clear images not clear images not clear images not clear
images not clear
images not clear
 
images not clear
images not clear
 
-->