|
-
Nov 7th, 2008, 09:20 PM
#1
Thread Starter
Member
VB6 - Breaking up an image?
I made a game called slider where you move pieces of an image around to make the full image, and right now I just have 9 different images (8 pieces and the full). I was wondering, is there a way to break up a full image into smaller pieces? Example, here's a screen of what I have now:

Thanks
-
Nov 7th, 2008, 09:31 PM
#2
Re: VB6 - Breaking up an image?
The easy way. Are you familiar with VB's PaintPicture function? Once you have an image loaded into a picturebox with its AutoRedraw & AutoSize set to true, you can divide the width/height by 3. Then you can use PaintPicture to draw the portions to 8 other picture boxes.
That was the easy way, maybe not the best and maybe not suited for your needs.
-
Nov 7th, 2008, 09:46 PM
#3
Thread Starter
Member
Re: VB6 - Breaking up an image?
Alright, thanks. I'll do some research on PaintPicture.
Edit: What exactly is an image's scalewidth and scaletop etc?
Last edited by MountainDew7; Nov 7th, 2008 at 10:05 PM.
-
Nov 8th, 2008, 01:05 PM
#4
Lively Member
Re: VB6 - Breaking up an image?
You can load the complete image into a PictureClip control and set the Rows = 3 and the Cols = 3 to give you the 9 segments that you need.
-
Nov 8th, 2008, 01:12 PM
#5
Re: VB6 - Breaking up an image?
 Originally Posted by MountainDew7
Edit: What exactly is an image's scalewidth and scaletop etc?
Images don't have scalewidth, scaletop, etc. The form & many controls (picturebox for example) do have these properties. They are the inside dimensions of the object vs the outside dimensions. The only time both will be the same is if the control is borderless, otherwise, the outside dimensions will always be bigger. Now, ScaleMode is important. Personally, I always find that when working with graphics, change the scalemode of graphical controls to vbPixels vs the default vbTwips. Pixels are more human-friendly in my opinion. To convert between 2 different scalemodes, one would use the ScaleX and ScaleY functions.
Last edited by LaVolpe; Nov 8th, 2008 at 01:15 PM.
-
Nov 11th, 2008, 11:59 AM
#6
Thread Starter
Member
Re: VB6 - Breaking up an image?
The pictureclip was so easy to work, thanks 
But now, how can I get a thing to pop up where I pick a file in the middle of running the program?
Last edited by MountainDew7; Nov 11th, 2008 at 12:04 PM.
-
Nov 11th, 2008, 05:07 PM
#7
Re: VB6 - Breaking up an image?
PictureClip is a nice control, but it still is a separate file that you will need all the time for your application to work.
I personally try and use API's instead of relying on other controls.
I'd recommend you use BitBlt API which could do the same thing as the PicClip so you wouldnt need any external files.
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

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
|