Results 1 to 7 of 7

Thread: any controls for zoom in zoom out and can copy area selected or draw or move in image

  1. #1

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    any controls for zoom in zoom out and can copy area selected or draw or move in image

    hi i hv some samples about zoom in zoom out in image and can draw and move in area in image but i need more help about better control or activex.
    and i need can select area for copy too in int.
    any body here can help more?
    i need more samples

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: any controls for zoom in zoom out and can copy area selected or draw or move in i

    You've posted this in the CodeBank forum. That's a place for sharing working code samples, not for asking questions. I've asked the mods to move this thread to the VB6 forum.

  3. #3

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: any controls for zoom in zoom out and can copy area selected or draw or move in i

    i can not found any controls to can support zoom in zoom out and drawing in same time.i am use attached source code (image control) but i hv a big porblem for show larg size.
    download attachment and test. ( ctrl+ and ctrl- for zoom)
    my porblem is about show 100% image in first run .i want see image in 100 % view,can u or any body fix this problem and then send here again?)
    i puted a sample image in source code too.just run it and see problem.

    i want see image in first time load image like this :
    Name:  001.jpg
Views: 383
Size:  57.0 KB
    Attached Files Attached Files

  4. #4
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    673

    Re: any controls for zoom in zoom out and can copy area selected or draw or move in i

    Dim dHRatio As Double
    Dim dVRatio As Double
    Dim dRatio As Double
    srcW = iSrc.Width
    srcH = iSrc.Height
    dHRatio = dstW / srcW
    dVRatio = dstH / srcH

    If dHRatio > dVRatio Then
    dRatio = dVRatio
    Else
    dRatio = dHRatio
    End If
    SetStretchBltMode iDst.hDC, 4 'STRETCH_HALFTONE
    '// Draw it
    lRet = StretchDIBits(iDst.hDC, dstX, dstY, srcW * dRatio, srcH * dRatio, SrcX, SrcY, srcW, srcH, tBM.Bits(0, -2, -2), tBM, DIB_RGB_COLORS, SRCCOPY)


    you can search GdipDrawImageRectRectI
    Last edited by xxdoc123; Feb 11th, 2018 at 01:20 AM.

  5. #5

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: any controls for zoom in zoom out and can copy area selected or draw or move in i

    Quote Originally Posted by xxdoc123 View Post
    Dim dHRatio As Double
    Dim dVRatio As Double
    Dim dRatio As Double
    srcW = iSrc.Width
    srcH = iSrc.Height
    dHRatio = dstW / srcW
    dVRatio = dstH / srcH

    If dHRatio > dVRatio Then
    dRatio = dVRatio
    Else
    dRatio = dHRatio
    End If
    SetStretchBltMode iDst.hDC, 4 'STRETCH_HALFTONE
    '// Draw it
    lRet = StretchDIBits(iDst.hDC, dstX, dstY, srcW * dRatio, srcH * dRatio, SrcX, SrcY, srcW, srcH, tBM.Bits(0, -2, -2), tBM, DIB_RGB_COLORS, SRCCOPY)


    you can search GdipDrawImageRectRectI
    hi i added this code but now zoom hv problem(zoom not worked),can u fix that source code ?
    i want when i set picture then can see picture at 100 % like #3 and can zoom in and zoom out too.
    can u fix source code in #3 and then send here again?

  6. #6
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    673

    Re: any controls for zoom in zoom out and can copy area selected or draw or move in i

    I simply changed a bit.Maybe not perfect
    Attached Files Attached Files
    Last edited by xxdoc123; Feb 13th, 2018 at 02:53 AM.

  7. #7

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: any controls for zoom in zoom out and can copy area selected or draw or move in i

    hi thanks for your help,but problem not fixed yet,can change better i want see loaded image with same size of user control and at first view with 100 % preview and can zoom in zoom out standard.
    i attached 2 problem :
    Name:  01.jpg
Views: 373
Size:  14.3 KB
    and problem 3 is about zoom because after zoom in , zoom factor changed to 2.1 but should be change to 1.1 or like this.

Tags for this Thread

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