3 Replies - 596 Views - Last Post: 05 October 2012 - 05:09 PM Rate Topic: -----

#1 deanobravo  Icon User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 131
  • Joined: 02-January 12

VB Powerpack printing wrong color

Posted 04 October 2012 - 11:18 PM

Imports Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Public Class Form1

    Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click

        Dim Printer As New Printer

        Printer.ForeColor = System.Drawing.Color.Red.ToArgb
        Printer.Print("abcdefghijklmnopqrstuvwxyz")

        Printer.EndDoc()

    End Sub




The above code prints text to a page in the color blue.
And it seems to print any selected color incorrectly e.g. Aqua prints yellow, blue prints red
I thought there was something wrong with the rest of my code so whittled it right down to the above and it still does it???!!
I should also mention it is NOT a printer problem.

This post has been edited by deanobravo: 04 October 2012 - 11:21 PM


Is This A Good Question/Topic? 0
  • +

Replies To: VB Powerpack printing wrong color

#2 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: VB Powerpack printing wrong color

Posted 05 October 2012 - 03:50 AM

CHECK FOR THIS,,GUD LUCK

My link
Was This Post Helpful? 0
  • +
  • -

#3 deanobravo  Icon User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 131
  • Joined: 02-January 12

Re: VB Powerpack printing wrong color

Posted 05 October 2012 - 03:59 PM

The problem seems to be with the ToArgb function.
I created my own:
Public Function convertToInteger(ByRef A As Short, ByVal R As Short, ByVal G As Short, ByVal B As Short) As Integer

        convertToInteger = R + (G * 256) + (B * 256 * 256)

    End Function


This worked!
I'm not to sure what the A part does so I ignored it.
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2256
  • View blog
  • Posts: 9,444
  • Joined: 29-May 08

Re: VB Powerpack printing wrong color

Posted 05 October 2012 - 05:09 PM

A stands for Alpha and indicates the translucency of that pixel.

This post has been edited by AdamSpeight2008: 05 October 2012 - 05:12 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1