[RESOLVED] slideshow image urgent-VBForums
Results 1 to 11 of 11

Thread: [RESOLVED] slideshow image urgent

  1. #1

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Resolved [RESOLVED] slideshow image urgent

    i want to make a image slideshow like this



    when image is added the current image should move to the left and preview the new added + need the slider to go back and forward or click image to view please urgent
    Last edited by ladoo; Jan 6th, 2013 at 10:36 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,363

    Re: slideshow image urgent

    The only helpful item for doing most of this that comes with VB6 is the DataRepeater control. However it requires more setup work than 99.999% of VB6 programmers are willing to deal with, and it only scrolls vertically.

    You're going to have to roll your own. I'd start by looking at examples that show how to scoll the contents of a PictureBox and go from there.

  3. #3

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: slideshow image urgent

    ok thanks am looking forwad to doing this , as u se it shows add picture and , added pictures are added small icon when clicked preview is shown in big window how to do that

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,363

    Re: slideshow image urgent

    Maybe I have this wrong. Did you want to select picture files and have them go into some kind of horizontally scrollable list? Then you click on one in the list to show it as the larger image?

    Sort of like in this crude drawing where the user clicked on the 4th picture?
    Attached Images Attached Images  

  5. #5

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: slideshow image urgent

    wow u read my mind that is exactly what i want sir,

    can you also add a feature in project along with new picturebox if that picture is loaded then auto load that image into the scrollerbar area


    2nd feature.

    like add picture1 and command1 when u click command1 it should add and add that picture1 to scroller list , dont worry in my project i have picture1 image change when server sends to client and loads up the image in picture1 , so i hope u get the image in your head what i want.

    by the way it looks awsome.
    Last edited by ladoo; Jan 4th, 2013 at 05:38 AM.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,363

    Re: slideshow image urgent

    Well the bad news is... that was just a drawing, not a test program. I was just trying to understand what you need. I don't have any code to do this.

    So these pictures come from a network connection (Winsock or another socket library) and not from local disk files?

    It sounds like:
    • You get a picture from the server and put it into a PictureBox.
    • Then you want to click a Command button to "add" to the list.
    • After that you want to be able to scroll and click on the scrolling thumbnails to load the picture into a second PictureBox?


    I'm not quite sure when the "autoload" should happen.

    How many PictureBox controls do you have? Just one (big one) that shows both new pictures from the server and "picked" pictures from the scrolling list? Plus some little preview picture?

    Don't you need to also load new pictures from the local hard drive or someplace?


    Maybe none of those details matter though. Are you really mostly asking for a scrollable "image picker" with methods to AddNew, ClearAll, and FetchPicked image along with a Click event when clicked?

    Where would the full size images be cached? If the list gets long it could be a lot of memory. Maybe just have the thumbnails be in memory with the full size images in a temporary/working disk directory?

    Again, just trying to get the concepts clear. Maybe somebody else will make one before I get a chance to. I don't have anything for doing this sort of thing that I can change around.

    Lots of little things to do like make the scrolling thing itself as well as dealing with scaling and centering each full image as a thumbnail, etc.

  7. #7

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: slideshow image urgent

    Maybe none of those details matter though. Are you really mostly asking for a scrollable "image picker" with methods to AddNew, ClearAll, and FetchPicked image along with a Click event when clicked?




    yes i only want that sir rest i can manage

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,363

    Re: slideshow image urgent

    You may have made your own already, but if not perhaps ImageListPicker Control might work or serve as a starting point.

  9. #9

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: slideshow image urgent

    yes that will do thanks dilettante nice 1

  10. #10

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: slideshow image urgent

    help making picture1 resize

    Code:
    Private Sub PaintCentered(ByVal Pic As StdPicture)
        Dim Factor As Double
        Dim ScaledWidth As Single
        Dim ScaledHeight As Single
        
        With Picture1
            .Cls
            Factor = Pic.Width / ScaleX(.ScaleWidth, .ScaleMode, vbHimetric)
            If ScaleY(Pic.Height / Factor, vbHimetric, ScaleMode) > .ScaleHeight Then
                Factor = Pic.Height / ScaleY(.ScaleHeight, .ScaleMode, vbHimetric)
            End If
            ScaledWidth = ScaleX(Pic.Width / Factor, vbHimetric, .ScaleMode)
            ScaledHeight = ScaleY(Pic.Height / Factor, vbHimetric, .ScaleMode)
            .PaintPicture Pic, _
                          Fix((.ScaleWidth - ScaledWidth) / 2), _
                          Fix((.ScaleHeight - ScaledHeight) / 2), _
                          ScaledWidth, _
                          ScaledHeight
        End With
    End Sub
    add options in this code like
    hight = 200
    wighth = 200
    so i can then play with it till it works for me plz

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,363

    Re: [RESOLVED] slideshow image urgent

    That's part of the demo project and not the image picker itself.


    I'm not sure what you want to do differently in this code though. As it stands it just tries to scale the picture to fit within Picture1, maintaining the original aspect ratio and centered within Picture1.

    If you want the Picture1 control to change size you can use its .Move method or adjust its .Left, .Top, .Width, and .Height properties.

    If you want to "zoom" in or out you could use a Zoom argument (2.0 = 200%, 1.0 = 100%, 0.5 = 50%, etc.). If you want to force the Width or Height to a given value that should be easy enough too.

    Code:
    Private Sub PaintCentered( _
        ByVal Pic As StdPicture, _
        Optional ByVal MaxWidthPx As Single, _
        Optional ByVal MaxHeightPx As Single, _
        Optional ByVal Zoom As Single = 1#)
        Dim MaxW As Single
        Dim MaxH As Single
        Dim Factor As Double
        Dim ScaledWidth As Single
        Dim ScaledHeight As Single
        
        With Picture1
            .Cls
            If MaxWidthPx = 0 Then
                MaxW = ScaleX(.ScaleWidth, .ScaleMode, vbHimetric)
            Else
                MaxW = ScaleX(MaxWidthPx, vbPixels, vbHimetric)
            End If
            If MaxHeightPx = 0 Then
                MaxH = ScaleY(.ScaleHeight, .ScaleMode, vbHimetric)
            Else
                MaxH = ScaleY(MaxHeightPx, vbPixels, vbHimetric)
            End If
            Factor = Pic.Width / MaxW
            If Pic.Height / Factor > MaxH Then
                Factor = Pic.Height / MaxH
            End If
            Factor = Factor / Zoom
            ScaledWidth = ScaleX(Pic.Width / Factor, vbHimetric, .ScaleMode)
            ScaledHeight = ScaleY(Pic.Height / Factor, vbHimetric, .ScaleMode)
            .PaintPicture Pic, _
                          Fix((.ScaleWidth - ScaledWidth) / 2), _
                          Fix((.ScaleHeight - ScaledHeight) / 2), _
                          ScaledWidth, _
                          ScaledHeight
        End With
    End Sub

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.