Printer.Print LoadPicture - but no Picture 
Author Message
 Printer.Print LoadPicture - but no Picture

Hi All,

The code below is part of a dll.  The text prints out ok but the picture
does not...

It also doesn't give me an error so I know that it is finding the gif
ok.

Please take a look at the code and make sure there are no glaring
errors...

'--------------------
        Dim MsgArray() As String
        Dim sSNBLogo
        Dim ii

        sSNBLogo = App.Path & "\SNBLogo.gif"
        Dim oSNBLogo As IPictureDisp
        Set oSNBLogo = LoadPicture(sSNBLogo)
        MsgArray = Split(TemplateText, "<BR>")

        With Printer
            'Header...
            Printer.PaintPicture oSNBLogo, 1000, 1000

            'The Message...
            .FontSize = 10
            For ii = LBound(MsgArray) To UBound(MsgArray)
                Printer.CurrentX = 1000
                Printer.Print MsgArray(ii)
            Next
            Printer.EndDoc
        End With
'------------------------

Does anyone have any idea why this might not be loading the gif?

Thanks,

Phil Lamey

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sat, 23 Oct 2004 20:24:15 GMT  
 Printer.Print LoadPicture - but no Picture


Quote:
> Hi All,

> The code below is part of a dll.  The text prints out ok but the picture
> does not...

> It also doesn't give me an error so I know that it is finding the gif
> ok.

> Please take a look at the code and make sure there are no glaring
> errors...

> '--------------------
>         Dim MsgArray() As String
>         Dim sSNBLogo
>         Dim ii

>         sSNBLogo = App.Path & "\SNBLogo.gif"
>         Dim oSNBLogo As IPictureDisp
>         Set oSNBLogo = LoadPicture(sSNBLogo)
>         MsgArray = Split(TemplateText, "<BR>")

>         With Printer
>             'Header...
>             Printer.PaintPicture oSNBLogo, 1000, 1000

>             'The Message...
>             .FontSize = 10
>             For ii = LBound(MsgArray) To UBound(MsgArray)
>                 Printer.CurrentX = 1000
>                 Printer.Print MsgArray(ii)
>             Next
>             Printer.EndDoc
>         End With
> '------------------------

> Does anyone have any idea why this might not be loading the gif?

You've got With Printer, and then you've got Printer.PaintPicture. That's
like Printer.Printer.PaintPicture, which won't work.
HK


Sun, 24 Oct 2004 00:20:32 GMT  
 Printer.Print LoadPicture - but no Picture
But I am also doing a Printer.Print but that is working
for me....??

Quote:
>You've got With Printer, and then you've got

Printer.PaintPicture. That's

Quote:
>like Printer.Printer.PaintPicture, which won't work.
>HK
>-----Original Message-----



>> Hi All,

>> The code below is part of a dll.  The text prints out
ok but the picture
>> does not...

>> It also doesn't give me an error so I know that it is
finding the gif
>> ok.

>> Please take a look at the code and make sure there are
no glaring
>> errors...

>> '--------------------
>>         Dim MsgArray() As String
>>         Dim sSNBLogo
>>         Dim ii

>>         sSNBLogo = App.Path & "\SNBLogo.gif"
>>         Dim oSNBLogo As IPictureDisp
>>         Set oSNBLogo = LoadPicture(sSNBLogo)
>>         MsgArray = Split(TemplateText, "<BR>")

>>         With Printer
>>             'Header...
>>             Printer.PaintPicture oSNBLogo, 1000, 1000

>>             'The Message...
>>             .FontSize = 10
>>             For ii = LBound(MsgArray) To UBound
(MsgArray)
>>                 Printer.CurrentX = 1000
>>                 Printer.Print MsgArray(ii)
>>             Next
>>             Printer.EndDoc
>>         End With
>> '------------------------

>> Does anyone have any idea why this might not be loading
the gif?

>.



Sun, 24 Oct 2004 00:26:27 GMT  
 Printer.Print LoadPicture - but no Picture
I tried removing all the Printer.* from within "With
Printer" ... However that made no difference...I still got
the text but no picture...

Anyone have ANY idea what may be happening here?

...Phil Lamey

Quote:
>You've got With Printer, and then you've got

Printer.PaintPicture. That's

Quote:
>like Printer.Printer.PaintPicture, which won't work.
>HK
>-----Original Message-----



>> Hi All,

>> The code below is part of a dll.  The text prints out
ok but the picture
>> does not...

>> It also doesn't give me an error so I know that it is
finding the gif
>> ok.

>> Please take a look at the code and make sure there are
no glaring
>> errors...

>> '--------------------
>>         Dim MsgArray() As String
>>         Dim sSNBLogo
>>         Dim ii

>>         sSNBLogo = App.Path & "\SNBLogo.gif"
>>         Dim oSNBLogo As IPictureDisp
>>         Set oSNBLogo = LoadPicture(sSNBLogo)
>>         MsgArray = Split(TemplateText, "<BR>")

>>         With Printer
>>             'Header...
>>             Printer.PaintPicture oSNBLogo, 1000, 1000

>>             'The Message...
>>             .FontSize = 10
>>             For ii = LBound(MsgArray) To UBound
(MsgArray)
>>                 Printer.CurrentX = 1000
>>                 Printer.Print MsgArray(ii)
>>             Next
>>             Printer.EndDoc
>>         End With
>> '------------------------

>> Does anyone have any idea why this might not be loading
the gif?

>.



Sun, 24 Oct 2004 04:00:21 GMT  
 Printer.Print LoadPicture - but no Picture
Phil:
I'm not really sure what exactly you have there now, but instead of using
the with printer method, try eliminating that and just call the printer
object directly like:
*******************
    Dim MsgArray() As String
    Dim sSNBLogo As String
    Dim ii As Integer 'or long or whatever size the MsgArray is
    Dim oSNBLogo As Picture

    sSNBLogo = App.Path & "\SNBLogo.gif"
    Set oSNBLogo = LoadPicture(sSNBLogo)
    MsgArray = Split(TemplateText, "<BR>")

    'Header...
    Printer.PaintPicture oSNBLogo, 1000, 1000

    'The Message...
    Printer.FontSize = 10
    For ii = LBound(MsgArray) To UBound(MsgArray)
        Printer.CurrentX = 1000
        Printer.Print MsgArray(ii)
    Next
    Printer.EndDoc
*******************
I also define the data type in the DIM Statements. I haven't ever used the
IPictureDisp data type for a picture, but I couldn't when searching find a
lot of information on it. I've always used the Picture object, and haven't
had a problem. Of course I've never used it in a .DLL, but I would assume it
should work as well. I'm specifically looking on page 657 of the VB 6.0
Programmer's guide.
HK

Quote:
> I tried removing all the Printer.* from within "With
> Printer" ... However that made no difference...I still got
> the text but no picture...

> Anyone have ANY idea what may be happening here?

> ...Phil Lamey

> >You've got With Printer, and then you've got
> Printer.PaintPicture. That's
> >like Printer.Printer.PaintPicture, which won't work.
> >HK

> >-----Original Message-----



> >> Hi All,

> >> The code below is part of a dll.  The text prints out
> ok but the picture
> >> does not...

> >> It also doesn't give me an error so I know that it is
> finding the gif
> >> ok.

> >> Please take a look at the code and make sure there are
> no glaring
> >> errors...

> >> '--------------------
> >>         Dim MsgArray() As String
> >>         Dim sSNBLogo
> >>         Dim ii

> >>         sSNBLogo = App.Path & "\SNBLogo.gif"
> >>         Dim oSNBLogo As IPictureDisp
> >>         Set oSNBLogo = LoadPicture(sSNBLogo)
> >>         MsgArray = Split(TemplateText, "<BR>")

> >>         With Printer
> >>             'Header...
> >>             Printer.PaintPicture oSNBLogo, 1000, 1000

> >>             'The Message...
> >>             .FontSize = 10
> >>             For ii = LBound(MsgArray) To UBound
> (MsgArray)
> >>                 Printer.CurrentX = 1000
> >>                 Printer.Print MsgArray(ii)
> >>             Next
> >>             Printer.EndDoc
> >>         End With
> >> '------------------------

> >> Does anyone have any idea why this might not be loading
> the gif?

> >.



Mon, 25 Oct 2004 22:35:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to print a picture to Printer ?????????

2. Print transparent picture to Printer

3. How to print a picture to Printer ?????????

4. How to print .BMP format picture to printer?

5. printer doesn't print picture boxes

6. Printer.PaintPicture No Picture on Print out

7. problems printing on a zebra printer with printer.print

8. Picture Box and LoadPicture

9. sending picture box with picture and text to a printer device

10. Print to Picture and then saving the new picture

11. Q: Printing report on non-default printer w/o user selecting printer

12. Macro that selects printer and prints doc also changes default printer

 

 
Powered by phpBB® Forum Software