Results 1 to 11 of 11

Thread: Time-Travel successfully achieved...(sigh)....what shall I do now?

  1. #1
    Guest
    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.

  2. #2
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425
    I'd sooo love it if you could tell me what is wrong with my php script! Check out the thread before this one!

  3. #3
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089

    Here's a real Challenge for you.

    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.

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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.

  5. #5
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    Try fiddling with:
    Code:
    ' ComTech Presents...
    '   ________  ________   ________
    '  /\__   __\/\_____  \ /\  ____'\
    '  \/__/\ \_/\/_____/\ \\ \ \__/\ \
    '      \ \ \      __\_\ \\ \ \ \ \ \
    '       \ \ \    /\____  \\ \ \ \ \ \
    '        \ \ \   \/____/\ \\ \ \ \ \ \
    '       __\_\ \__   ___\_\ \\ \ \_\_\ \
    '      /\_________\/\_______\\ \_____,/
    '      \/_________/\/_______/ \/_____/
    ' http://www.Geocities.com/Warmaster2000us
    I3D is My Graphics engine that needs testers.
    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
    Designer/Programmer of the Comtech Operating System(CTOS)

  6. #6
    Guest
    Sam, What is a "DC"?

  7. #7
    Guest
    A DC is a device context. Most common use is for doing double buffered graphics

    - gaffa

  8. #8
    Guest
    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.

  9. #9
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    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
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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, ...
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    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.)
    Designer/Programmer of the Comtech Operating System(CTOS)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width