|
-
Jul 13th, 2007, 10:58 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Picture too small
I have problem here..
The picture display to small. How I can large the picture?
My scale mode is - Twip
Code:
Form5.legMapDisp.ExportToBmp (App.path & "\output.bmp")
Printer.CurrentX = 600
Printer.CurrentY = 12000:
'print legend
Printer.Print "Legend": ForeColor = vbBlack
Set Picture2 = LoadPicture(App.path & "\output.bmp")
Printer.PaintPicture Picture2, 60, 13000, 2000, 800
-
Jul 13th, 2007, 12:01 PM
#2
Re: Picture too small
How big (Width/Height) and where (X/Y) do you want to Print it?
This should center the Picture in the sheet (using Twips, real size, no streching)
Code:
Printer.PaintPicture Picture2, _
Printer.ScaleWidth / 2 - ScaleX(Picture2.Width, vbHimetric, vbTwips) / 2, _
Printer.ScaleHeight / 2 - ScaleX(Picture2.Height, vbHimetric, vbTwips) / 2
Printer.EndDoc
-
Jul 13th, 2007, 12:54 PM
#3
Thread Starter
Frenzied Member
Re: Picture too small
That good.That what I needed.So How I can move the picture by its X and Y location?
Code:
Printer.PaintPicture Picture2, _
Printer.ScaleWidth / 2 - ScaleX(Picture2.Width, vbHimetric, vbTwips) / 2, _
Printer.ScaleHeight / 2 - ScaleX(Picture2.Height, vbHimetric, vbTwips) / 2
-
Jul 13th, 2007, 12:56 PM
#4
Re: Picture too small
Printer.PaintPicture YourPicture, X, Y - 2nd and 3rd parameters are X and Y.
You can also use Printer.CurrentX and Printer.CurrentY to move to any position.
-
Jul 13th, 2007, 01:01 PM
#5
Thread Starter
Frenzied Member
Re: Picture too small
If I put like that it streaching.Right now, the picture show at the center. i just want to move this location but not involved too much changing of the picture location.At the same time I also want to preserve the picture behavior.
Code:
Printer.PaintPicture Picture2, 60, 13000, _
Printer.ScaleWidth / 2 - ScaleX(Picture2.Width, vbHimetric, vbTwips) / 2, _
Printer.ScaleHeight / 2 - ScaleX(Picture2.Height, vbHimetric, vbTwips) / 2
-
Jul 13th, 2007, 01:06 PM
#6
Re: Picture too small
That code is not correct, you added my code in the wrong place, that is suposed to center the picture using parameters 2nd and 3rd, not parameters 4th and 5th, 4th and 5th must be used to stretch, that's another thing.
I don't know what you mean by: "want to preserve the picture behavior."
-
Jul 13th, 2007, 01:12 PM
#7
Re: Picture too small
I assume your X = 60 and Y= 13000 are ok, that must be where you want the Picture to be.
Now, if you want to Stretch it (make it smaller or bigger) keeping the Picture Ratio (maybe you meant this when you said behavior) use something like this:
Code:
Dim lStretch As Single
lStretch = 0.5 'How small/Big it will stretch
Printer.PaintPicture Picture2, 60, 13000, _
ScaleX(Picture2.Width, vbHimetric, vbTwips) * lStretch, _
ScaleX(Picture2.Height, vbHimetric, vbTwips) * lStretch
Printer.EndDoc
If you change the value in lStretch, the Picture Size should change.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|