Results 1 to 11 of 11

Thread: Coordinates of Bitblt

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    I have Bitblt 75 pictures on my form. I want to be able to get the name of each picture as I drag my pointer over it! I think it would be best to use a class module but not sure.

    Please provide code for this.
    Chemically Formulated As:
    Dr. Nitro

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

    Smile

    I've Just got back from the pub so I'm really not in the mood to write some serious Code for you but I'm assuming you know how to use a class module and yeah, It's exactly what you need to use. set one up, give it a DC, a Rectangle (in VB Coords, let it do its own converting )a checkpoint function which checks if a point is in the classes area and make the class module subclass the form it's in to check for Paint events, It's entirely up to you whether you check for the mouse in the subclassing or use the mouse move event and check each object through a collection,If you want to re use the class It's best if you code both and let the user decide which method to use.

    Hope this helps.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Wink

    You don't need to subclass anything if you can make your form cowork with you classes, like sending them events.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Thanks Sam and Kedaman!

    I still need your help? I am still lose on the concept of DC. Therefore, I can not assign a tooltip to my picture.

    Bottom of the line, I am just pasting a bunch of pictures and want to get the name of the picture as I drag across.
    Chemically Formulated As:
    Dr. Nitro

  5. #5
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Hi Nitro,

    I don't know if this is gonna be be of any help but, i recall when i looked at the drag and drop samples it used a label control as the dragicon when actually (during the drag operation) dragging across, would it not be possible to set the caption property of the label (the dragicon) to the filename/picture being dragged?

    Hope i'm not confusing the issue
    DocZaf
    {;->

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Thanks for the Reply Zaf!

    I want to stay away from controls because my program is dynamic. It might have load up to a hundred pictures which in return means it has to load a hundred label controls.

    I was doing this before with image controls but realize it would much more efficient to just paint the picture on the form. The problem now is that I can't use the image control's "ToolTipText" property.

    Thanks Again.
    Chemically Formulated As:
    Dr. Nitro

  7. #7
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Sorry my Brother's down at the moment so I can't get at my machine because he's usually playing pinball. He's Going away tomorrow so I can Do some code but I'm not sure exactly what your trying to do. What you're saying sounds a lot like the image control. Especcially if you want tooltips (have you noticed that a form doesn't have a tooltiptext property and I don't know how to do it with the API which you'd have to do if you don't want to use image controls. You won't save much memory using a class rather than image controls.Post up exactly what you're trying to do and I'll see what I can suggest.


  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Thanks Sam!

    Well basically, I have a program that is loading in a directory of picture files. I was using image control before, but by the 50 picture, it started to get tremendously slow because the use of memory. Kedaman recommended using "BitBlt". Therefore, I tried his method and true indeed the pictures get painted on much quicker.

    Anyway to go into detail. When I click on an image control in my original program, it would open another form and load that picture file on to that form with the information of my colleagues on the bottom.

    All I need to know is how to click on a painted picture and load it into the other form. Plus, I also need to drag the painted picture to another location. That is easy because once I get the file name, I can just "BitBlt" it into another section of the form.

    Bottom of the line, I need to assign a unique name and coordinates to the painted picture and also be able to obtained.

    BTW...
    When I use the term painted picture means I "BitBlt" it on the form.


    Truly appreciated!

    [Edited by Nitro on 04-18-2000 at 04:59 PM]
    Chemically Formulated As:
    Dr. Nitro

  9. #9
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Just put up a load of image controls without pictures in them where the images will be. then you can bitblt to put the pictures on the form and you can use the image controls to handle the events.

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Kedaman recommend not to load so many image controls like the way I have it right now. I must agree with him because after loading 50 image controls, it would slow the program down.

    I am talking about hundreds of jpg files here.

    If I misunderstood you, I am sorry. Just that I am trying to create something similar to Paing Sho Pro when it does a browse on the directory.
    Chemically Formulated As:
    Dr. Nitro

  11. #11
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Have you thought about using the listview control, It's exactly like the windows explorer interface but you can use it in your progect, you can set the icons to your jPegs, I think you'll have to do some skillful work with the imagelist control to pull it off but you get a nice windows interface on your program and it'l use much less memory, I'm not too hot with these controls (I had to look up what the List view control does) so I'm not the guy to explain how but that's the way to do It, If you want to do all the coding yourself you're in the wrong language.

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