I need something to keep me occupied for the next week or so. Does anyone need a hand with a project they are working on? I'd like to help 'cos all I would be doing otherwise is sitting on my ass doing nothing.
I need something to keep me occupied for the next week or so. Does anyone need a hand with a project they are working on? I'd like to help 'cos all I would be doing otherwise is sitting on my ass doing nothing.
I'd sooo love it if you could tell me what is wrong with my php script! Check out the thread before this one!
See If you can work out how to create a StdPicture object from a DC. (IE attatch the Bitmap in the DC to the stdPicture object like it does in a picture box.)
I'm working on a wrapper for a DC so you can have a Memory DC nicely wrapped in a class module and get all the advantages without bothering with the API, but I want to give it a Picture and an Image Property.
Just to get you started I've found an object called an IPicture, which comes with VB but is Hidden and Undocumented.
Try this, put 2 pictureboxes and a command button on your form and add this code.
Code:Option Explicit
Private Sub Command1_Click()
'X is our IPicture object that we are investigating
Dim x As IPicture
'Y is a stdPicture Object
Dim Y As StdPicture
'We still need to set X to something with a bitmap in it
Set x = Form1.Image
'I'm not sure what this does, but it looks like a way of attatching a DC to the object
Call x.SelectPicture(Picture1.hDC, Picture1.hDC, Picture1.Image)
Set Y = x
Call Picture2.PaintPicture(Y, 0, 0)
End Sub
'This is just so we can draw in picture 1
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
Picture1.Line -(x, Y)
End Sub
Have a play with drawing to picture1 and clicking the command button, see what happens to picture 2, there are other properties and methods in the IPicture so see what you can do with them.
I would be eternally greatful If you could crack that, I'm gonna have a bash at it when I get time but If you could have a look at it beforehand thatd' be great.
I've just thought you may need to create a new stdPicture object with a bitmap in it, the best way to do this is is to use a resource file with a small blank bitmap in it.theres some stuff hereablout resource files.
Try fiddling with:
I3D is My Graphics engine that needs testers.Code:' ComTech Presents...
' ________ ________ ________
' /\__ __\/\_____ \ /\ ____'\
' \/__/\ \_/\/_____/\ \\ \ \__/\ \
' \ \ \ __\_\ \\ \ \ \ \ \
' \ \ \ /\____ \\ \ \ \ \ \
' \ \ \ \/____/\ \\ \ \ \ \ \
' __\_\ \__ ___\_\ \\ \ \_\_\ \
' /\_________\/\_______\\ \_____,/
' \/_________/\/_______/ \/_____/
' http://www.Geocities.com/Warmaster2000us
You said that you needed something to do for
the next week, how about trying my new GFX
Engine. Use the address above and
Good Graphics programming :)
Sam, What is a "DC"?
A DC is a device context. Most common use is for doing double buffered graphics
- gaffa
Sam,
I have absolutely no idea what you want this code to do. Could you explain a bit more, ie. why you are doing it in the first place?
Thanks.
Hey warmaster, that ASCII logo you made looks sooo cool :)
How did you make it? by hand or do you have prog for it?
Looks to cool to make a prog to do it :)
Sam wants to have a wrapper class for a memory DC, ie a bitmap image that can be generated/changed on the fly. He wants it to be compatible with StdPicture, so that you can do something like this:
Code:Dim x as New SamPic
x.SetSize(100,100)
...draw to x.DC
Picture1.PaintPicture x, ...
Thanks for the compliment. I made the logo by hand(typing). It took about 20-30 minutes to make. It was actually was pretty easy. It just took a while. Experiment a bit with I3D...(I3D doesn't do anything like this, but It's a GFX Engine for 3D drawing.)