Darwinbots Forum

Code center => Darwinbots Program Source Code => Topic started by: Zelos on January 08, 2006, 03:08:07 AM

Title: Picturebox load
Post by: Zelos on January 08, 2006, 03:08:07 AM
is it possible to set like
Code: [Select]
pic(0 to 100) as pictureboxand then use it to store pictures loaded from the hardrive? ive tried but it just complains, and if it does work how do I do? or do I have to create picture box after picturebox to store them all as I program?
Title: Picturebox load
Post by: Numsgil on January 08, 2006, 03:09:33 AM
I'm not sure exactly what you're asking.  What are you trying to do?
Title: Picturebox load
Post by: Ulciscor on January 08, 2006, 05:32:30 AM
If you mean can you load an array of pictureboxes at runtime as an array then yes I think you can. This is easier than actually making 101 pictureboxes and loading pictures into them at design time, as you say.

This link may help:

http://www.vbwm.com/art_1999/whatsnew/dynctrl.asp (http://www.vbwm.com/art_1999/whatsnew/dynctrl.asp)
Title: Picturebox load
Post by: PurpleYouko on January 08, 2006, 02:49:22 PM
Try using an "image" object at design time. This remains invisible but acts as an array that can store pictures. You can load them into it at either design time or run time.
Title: Picturebox load
Post by: Zelos on January 09, 2006, 02:04:35 AM
hmm, is it possible to store pics without having a equal amount of images?
Title: Picturebox load
Post by: Zelos on January 12, 2006, 01:04:36 PM
is it possible in vb to mirror a picture so the sides changes?
Title: Picturebox load
Post by: Zelos on January 14, 2006, 07:48:39 AM
the array thing have ive solved, what about mirrir effect?
Title: Picturebox load
Post by: PurpleYouko on January 14, 2006, 12:26:41 PM
Not quite sure what you mean. Can you explain a little?
Title: Picturebox load
Post by: Zelos on January 14, 2006, 02:05:19 PM
just a effect that makes the mirror effect of a pic, left becomes right and right becomes left
Code: [Select]
Private Declare Function BitBlt Lib "gdi32.dll" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal width As Long, ByVal height As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Const sp_width = 8
Const sp_height = 5

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim p(1 To 2) As StdPicture
Set p(2) = LoadPicture("C:\Documents and Settings\Pelle\Mina dokument\RPG\General Items\Bottle Liquids\Blod.gif")

x = Form1.width / 2
y = Form1.height / 2
   'BitBlt Form1.hDC, x, y, sp_width, sp_height, Image1.Picture, 0, 5, vbSrcAnd
  'BitBlt Form1.hDC, x, y, sp_width, sp_height, Image1.Picture, 0, 0, vbSrcPaint
BitBlt Form1.hDC, x, y, sp_width, sp_height, p(2).hDC, 0, 0, vbSrcCopy
End Sub

ive created this code, it just complain, why? can someone tells me what im doing wrong?
you migiht need to change the path of the file. here is the file anyhow
Title: Picturebox load
Post by: PurpleYouko on January 15, 2006, 11:06:29 AM
Using BitBlt eh?

That is fairly advanced programming. Congratulations on getting this working at all. It took me ages to get BitBlt to work in any programs and I still don't fully understand all its capabilities.
I haven't ever tried to use a mirror effect so I can't really help you without researching it a little myself first.

Are you getting the main picture to work properly with the BitBlt function? What exactly happens that is not right?
Title: Picturebox load
Post by: Zelos on January 15, 2006, 11:20:58 AM
when I put the image in a picture box it worx. but if I load it and store its as a array it doesnt, I just need to get it to be able to read from the stored array
Title: Picturebox load
Post by: Numsgil on January 15, 2006, 04:51:49 PM
You should try and find a VB game programming forum to help you.  You're fast approaching the edge of our expertise (DB didn't really do much advanced graphics programming).
Title: Picturebox load
Post by: PurpleYouko on January 15, 2006, 07:16:03 PM
try gamedev.net (http://www.gamedev.net/)

There are some very useful tutorials there.