Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tile and scale image in Picture Box ? 1

Status
Not open for further replies.

CubeE101

Programmer
Joined
Nov 19, 2002
Messages
1,492
Location
US
Is there a way to tile and scale and image in a Picture Box?

Say you have a gradient BitMap 1 pixel high by 256 wide

Is there a way to tile it vertically in a Picture box, and scale the width to the Width on the PictureBox?

Thanks in advance,
-Josh

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Try this.

Dim pic1 As StdPicture
Dim x As Long
Dim y As Long
Dim j As Long
Dim k As Long
Set pic1 = LoadPicture("C:\SomeFolder\SomePic.bmp")
x = 1
y = 6
Picture1.Scale (0, 0)-(x, y)
For j = 0 To x - 1
For k = 0 To y - 1
Picture1.PaintPicture pic1, j, k, 1, 1
Next k
Next j


"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
That'll work, Thanks.

I just switch the LoadPicture() with an imageList reference:

Set pic1 = LoadPicture("C:\SomeFolder\SomePic.bmp")

Set pic1 = ImageList1.ListImages("Red").Picture

Have a star!

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top