Page 18 of 18 FirstFirst ... 815161718
Results 681 to 698 of 698

Thread: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

  1. #681
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    135

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Can Alpha Image Control be used to draw a 8bit transparency image in a transparent form? I'm failing to do it.
    I can make the form transparent, but alpha image controls mix the backcolor of the form instead of transparency.

    Name:  Fail_ImageControlTransparency.jpg
Views: 493
Size:  12.2 KB

  2. #682
    Member
    Join Date
    Oct 2018
    Posts
    32

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Quote Originally Posted by LaVolpe View Post
    NOTICE :: NOTICE :: NOTICE

    Version 2 of the control came to an end. No new enhancements will be added to version 2. Bug fixes may be applied as they are discovered. Support for version 2 will eventually cease.

    Version 3 of the control will replace version 2 and will be DPI-aware. This will result in how images are loaded and displayed on a PC based on DPI settings (XP and above). In the case of icons/cursors, it may also result in which sized icon is displayed, based on current DPI settings. Externally, how you use this control will not change very much. Internally, a logical coordinate space will be used for all measurements and storage of properties, unlike the physical coordinate space now used. Like VB, this control will use twips internally. Externally to control users, pixels will still be used. DPI awareness will also be a customizable property. To properly support DPI-awareness, binary compatibility will be broken; hence a new version.
    __________________________________________________________

    15 Jan 2012. Minor patch applied. See change history below
    ----------------------------------------------------------

    Purpose: A control that allows viewing & creating many image formats, particularly alpha-blended ones.
    This control is very similar in appearance and functionality to VB's Image Control. However, this control is super-sized. Requires GDI+ on the computer. Not a major issue nowadays. And GDI+ v1.0 can be redistributable if it doesn't exist. Advanced effects supported if system has GDI+ v1.1 installed (see posts #2 & 3 below).

    Image formats supported: PNG (animated PNG too), TIFF (multi-page ones too), Icons, Cursors, Animated Cursors, JPEG, TGA, GIF (all frames), Bitmap, WMF, EMF, PCX, PBM, PGM, PPM, PAM, AVI, and those same formats contained inside MP3/WMA files, if they can be parsed out.

    Image sources supported: Files (unicode supported), arrays, stdPicture object, Clipboard object, Screen object (snapshots), OLE Drag/Drop Data object, this control's .Picture property, VB's LoadResData/LoadResPicture functions, bitmap/icon handles and URLs to images (unicode & async requests supported). Also can extract images from binaries such as exe, dll and ocx files. Supports loading images from strings containing Base64 encoding. Control can now be data-bound to a database table/field.
    See LoadPictureGDIp.rtf & SavePictureGDIp.rtf files included in zip.

    For more advanced users: special Pre & Post painting events allow you to modify the control's content during its rendering process. This literally allows the control to act as a blank canvas. Don't respond to those events & image renders as usual. Respond and you can change the background before image is rendered & even prevent image from rendering; you can also modify the control after the image is rendered but before it is displayed. Two of the sample projects use those events to show how powerful they are.

    Unlike VB's image control, a few global methods are designed to allow you to draw directly to any DC you desire. TilePictureGDIplus will tile a source image and can fill a form very quickly. PaintPictureGDIplus will draw an image to any DC. The control, itself, has a method to draw itself to another DC also: PaintControlAsDrawnToHDC. Additionally, there are methods that can be used for non-drawing: the UnicodeFileDialog class can be used from your project; giving you a unicode-aware common dialog substitute. The global ConvertRGBtoARGB & ConvertARGBtoRGB methods are useful conversion utilities that also accept VB system colors (i.e., vbButtonFace). The global GetScaledContainerSize & GetScaledImageSize methods are useful for scaling a container to image or vice versa. As long as the global GDIplusTokenExists method returns true, you never have to create your own GDI+ startup/shutdown routines; the GDIplusTokenVersion method lets you know which version of GDI+ is running

    ** Control performance is degraded while uncompiled. When compiled, you will experience far better performance

    Recommend you open the AICGlobals class and read the detailed comments for usage of the main functions. You can get more information about the control's properties, methods and events by reading the code or using your Object Browser (F2).
    See next post for a summary of the properties, methods, and classes this control exposes.

    To add an image during design time, simply add a control to the form, right click on it, and select Properties.
    You can also double click on the "Custom" property sheet item.


    Look closely at the screenshot below.
    See toucan's shadow over the playing card? See the grid dots in the shadows?
    That's alpha-blending at work!!!

    Attachment 80845

    Following is history of most recent changes. The control itself has complete change history included
    Any changes to the control may have spawned updates to 1 or more sample projects.
    Code:
    15 Jan 2012, version 2.1.32: Final update barring bugs
    - UnicodeBrowseFolders class can now be created/called from within your projects
    - Property page could return 32 & 48 sized associated icons in PNG format & shouldn't. Fixed
    8 Jan 2012, v2.1.31
    - property page for dragged/pasted files now coded to have them relate to associated icons, as appropriate
    7 Jan 2012, v2.1.30
    - can load icons associated with file system objects
    - modified property page for associated icon selection
    - added ASSOCIATEDICON structure, SHILIconSizeEnum & AssocIconTypeEnum enumerations
    - added UnicodeBrowseFolders global class
    - updated LoadPictureGdip & SavePictureGDIp RTF files
    - fixes a logic error where control may not resize while it is hidden
    - fixes issue where app may create metafile of text copied to clipboard & control loads that metafile instead of using the text to load an image
    26 Nov 2011, v2.1.29
    - Error converting black/white icons/cursors when loaded by handle. Fixed
    16 Nov v2.1.28
    - Allows saving unmodified AVI to other destinations (i.e., file, array, etc) 
    - Found & fixed several minor bugs
      -- cFunctionsICO.HICONtoArray custom header changes prevented loading icons by handle
      -- cFunctionsPNM.LoadPNMResource invalid flag setting could invert PBM formats
      -- cFunctionsPNM.pvBuildPNM saved invalid token when writing 32 bpp alpha PAM formats
      -- cFunctionsTGA.SaveAsTGA could save image upside down
      -- cFunctionsPCX.SaveAsPCX could save image upside down
    - Property page did not offer AVI as an image source
    7 Nov v2.1.27
    - test code from a few versions ago remained by mistake. Could crash project. Fixed
    6 Nov v2.1.26
    - error in MP3 tag parsing routine could occur with tags of less than 30 bytes. Fixed
    3 Nov v2.1.25
    - added WMA files as an image source
    - enabled control to be bound to a database table/field. See LoadPictureGDIp.RTF for more
    - added UpdateDataboundImage event to allow changing what will be saved before image written to database (databound control)
    - rewrote the MP3 parsing logic; more robust & should properly handle v2,3,4 ID3 tags + unsynchronized tags
    For the 8 sample projects provided...
    1) Open the uncompiled alpha image project first (contained in the AlphaImgControl.zip file)
    2) From the IDE menu: File | Add Project
    3) Navigate to & select a sample project
    4) Right click on it in the project explorer (treeview) & select: Set as Start Up
    Now run the sample project. When done playing, remove the sample project, navigate to one of the others & run it.
    Ensure you change the start-up project. You do not want the attached image control as the start-up project.

    You will really like the "custom buttons" project. Shows how flexible this control really is.
    Note: Sometimes I occasionally get an error when trying to load a sample project. This almost always happens after I've modified the uncompiled alpha image control. If that happens to you, simply close the sample project without saving changes, close the alpha image control project. Now try again.

    Tips
    1. Extract both zips, into same parent folder, using the "Use Folder Names" option
    2. When recompiling this control over an existing, compiled, version always opt for Binary Compatibility from the project properties window, on the Component tab. See this thread for a bit more information on binary compatibility. Binary compatibility if used allows already compiled/distributed apps using the control to continue using a newer version when it is distributed. I will make every effort in future revisions to maintain binary compatibility.
    Hi, Lavolpi!

    Where can I find the latest version of Alpha Image Control v2?

    Regards!

  3. #683

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,536

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Version 3 is on my list of things to do. Not done yet and don't know when it will get done.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #684
    New Member
    Join Date
    May 2018
    Posts
    6

    Resolved Re: [vb6]Alpha Image Control (PNG, AniGIFs, TIFF, & more) [23 Sep 2011]

    [QUOTE=LaVolpe;4073183]Regarding cropping: Well, you can already do that with existing methods:

    Code:
    Option Explicit
    ' in this example, the control's parent scalemode is pixels
    
    Private Sub AlphaImgCtl1_Click()
        CropImage AlphaImgCtl1, 30, 30, 100, 100
    End Sub
    
    Private Sub CropImage(theImage As AlphaImgCtl, X As Long, Y As Long, _
                            Width As Long, Height As Long)
        
        ' the AlignCenter property should already be set to False for better runtime visual change
        With theImage
            .SetRedraw = False
            .AlignCenter = False
            .AutoSize = lvicNoAutoSize
            ' ensure X, Y are pixel scalemode 
            .SetOffsets -X, -Y
            ' ensure X, Y, Width, Height are appropriate container scalemode
            .Move .Left + X, .Top + Y, Width, Height
            .SetRedraw = True
        End With
            
    End Sub
    Edited yet again. The above code works extremely well if Aspect is actual size; otherwise, it doesn't because resizing the control changes the dimensions of rendered image which means it isn't really designed to crop while stretched or scaled without a lot of extra calculations from you, including drawing in the PrePaint event (or saving the image to a new GDIpImage object with scaled dimensions ahead of time)

    *********************************************************
    Hi Lavolpe I just now try this code for cropping function. It's work very well.

    but I have an issue.
    :CropImage AlphaImgCtl1, 30, 30, 100, 100:

    Now I altered the values to this

    CropImage AlphaImgCtl1, 0, 0, AlphaImgCtl1.Picture.Width , AlphaImgCtl1.Picture.Height

    After result Image Crop height size is Ok but Image width size is crop to my desktop screen resolution width only.

    Selected Image width size is 1800 pixels. After result it crop to my desktop screen resolution (1366) width only

    Please help me how to crop an image actual width.

    Thanks Advance.
    Last edited by doss; Dec 30th, 2019 at 03:03 AM. Reason: Hilight text color changing

  5. #685

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,536

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Replied to your PM. Basically, there are some restrictions made within the code to prevent the AIC from being sized larger than a full screen. The restrictions can be found, and commented out, in sptGetScaledSizes
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #686
    New Member
    Join Date
    Oct 2015
    Posts
    11

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Dear LaVolpe.

    A photo when opened in image editing programs is displayed correctly, however when loaded in Alpha Image Control it is automatically rotated counterclockwise.
    Name:  IMG1.png
Views: 239
Size:  164.8 KB
    Name:  IMG2.png
Views: 241
Size:  30.0 KB

    The image is 3456x4608 72 dpi jpg photo from a smartphone.

    Any guess about what is happening?

    Thank you in advance!

  7. #687
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    135

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Quote Originally Posted by zeilo View Post
    Any guess about what is happening?
    Yes, that's because your photo got information about orientation in the EXIF information saved from the camera/phone wich take it. Some programas read it and change orientation based on that. Other software ignore it and just display the image as it was saved.

  8. #688
    New Member
    Join Date
    Oct 2015
    Posts
    11

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Thank you very much shagratt!!!

    I think there is a bug in the SetClipRect method:

    '/// sets optional clipping on the rendered image. Border usage is exempt from clipping
    Public Sub SetClipRect(ByVal X As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long, Optional ByVal Refresh As Boolean = True)
    Attribute SetClipRect.VB_Description = "Method clips the control's graphic output"
    ' pass width and/or height as zero to remove clipping rectangle
    If (Width Or Height) = 0 Then
    SetRect m_ClipRect, 0&, 0&, 0&, 0&
    If Refresh Then UserControl.Refresh
    ElseIf (Width > 0& And Height > 0&) Then
    SetRect m_ClipRect, X, Y, Width + X, Height + X
    If Refresh Then UserControl.Refresh
    End If

    End Sub


    It should be Height + Y instead of Height + X

  9. #689

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,536

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    @Zeilo. Yes, should be Hieght + Y

    Regarding JPG. To address the camera orientation, the information should exist in the JPG's metadata and if it does exist, auto-orientation can be applied to correct it. Here's how to adapt the AIC for those types of JPGs.

    1. In modCommon LoadImage function, find this line: Case lvicPicTypeJPEG
    Immediately after that line, insert this: Call pvAutoOrientateJPG(cImageData)

    2. At the bottom of modCommon, add the new pvAutoOrientateJPG method
    Code:
    Private Sub pvAutoOrientateJPG(cImageData As cGDIpMultiImage)
    
        Dim lSize As Long, lValue As Long
        Dim arrData() As Byte, lOrient As Long
        Dim tImageData As cGDIpMultiImage, hBmp As Long
        Const PropertyTagOrientation  As Long = &H112&
    
        GdipGetPropertyItemSize cImageData.Handle, PropertyTagOrientation, lSize
        If lSize = 18& Then
            ReDim arrData(0 To lSize - 1&)
            If GdipGetPropertyItem(cImageData.Handle, PropertyTagOrientation, lSize, arrData(0)) = 0& Then
                CopyMemory lSize, arrData(4), 4&
                If lSize = 2& Then
                    CopyMemory lValue, arrData(8), 4&
                    If lValue = 3& Then
                        lOrient = arrData(16) Or arrData(17) * &H100&
                        Select Case lOrient
                        Case 2, 4: lOrient = lOrient + 2    ' RotateNoneFlipX, Rotate180FlipX
                        Case 6, 8: lOrient = lOrient - 5    ' Rotate90FlipNone, Rotate270FlipNone
                        Case 1, 3: lOrient = lOrient - 1    ' Rotate180FlipNone
                        Case 5, 7                           ' Rotate90FlipX, Rotate270FlipX
                        Case Else: lOrient = 0&             ' invalid value
                        End Select
                    End If
                End If
            End If
        End If
        If lOrient > 0& Then
            GdipImageRotateFlip cImageData.Handle, lOrient
            GdipCreateHBITMAPFromBitmap cImageData.Handle, hBmp, -1&
            If hBmp <> 0 Then
                Set tImageData = New cGDIpMultiImage
                pvProcessGDIhandleSource tImageData, hBmp, False
                Set cImageData = tImageData
            End If
        End If
    
    End Sub
    3. Add this new API towards top of modCommon
    Code:
    Private Declare Function GdipImageRotateFlip Lib "GdiPlus.dll" (ByVal pImage As Long, ByVal rfType As Long) As Long
    With the above changes, all JPGs will be tested for non-standard orientation and auto-corrected. If auto-correction is needed, then the JPG will be converted to a Bitmap and no longer be a JPG. If no auto-correction is needed, no action taken.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  10. #690
    New Member
    Join Date
    Oct 2015
    Posts
    11

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Thank you very much LaVolpe!!!

    Great job! Now is working perfectly!

  11. #691
    New Member
    Join Date
    Oct 2015
    Posts
    11

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Thank you very much LaVolpe!!!

    Great job! Now is working perfectly!

  12. #692
    Addicted Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Posts
    242

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    i have new problem for open orginal source.when i want open source just see this error : expersion too complex how can fix that?

  13. #693

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,536

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Quote Originally Posted by Black_Storm View Post
    i have new problem for open orginal source.when i want open source just see this error : expersion too complex how can fix that?
    Search the code for "Not Not". I don't think I use that code in that project, but am not looking at the code right now. You may have that code in another part of your project somewhere. If so, post the question in the general questions portion of the forum. If you find it in the alpha image control, let me know. I can take a look tomorrow when I get home from work.

    Ugh, I see you posted the question several times elsewhere. At least figure out which control is generating the error vs. sending this question to each person that wrote a control you are using, hoping one of them will do your debugging for you.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  14. #694
    Addicted Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Posts
    242

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Quote Originally Posted by LaVolpe View Post
    Search the code for "Not Not". I don't think I use that code in that project, but am not looking at the code right now. You may have that code in another part of your project somewhere. If so, post the question in the general questions portion of the forum. If you find it in the alpha image control, let me know. I can take a look tomorrow when I get home from work.

    Ugh, I see you posted the question several times elsewhere. At least figure out which control is generating the error vs. sending this question to each person that wrote a control you are using, hoping one of them will do your debugging for you.

    i find a way for fix this porblem but i think this is not good idea,i unchecked ax-tools code smart 2013 from add in manager and then restart vb and no problem now,i think this porblem is about IDE editor.

    but i have a simple question now

    i loaded a image from https like as this :
    Code:
    Private myloader As AICGlobals
    Set myloader = New AICGlobals
    'img is alpha image control
    Set img.Picture = myloader.LoadPictureGDIplus("https://.... url",,false)
    for example this image is 300*300 pixel,now i want save this picture to png format croped to 230*230.
    this code workd for me for save just

    Code:
    myloader.SavePictureGDIplus img.Picture, SavePath, lvicSaveAsPNG
    but how can crop and save?

  15. #695

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,536

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Cropping? Start on page 7, post 245. Read that one and the next few. There are a couple options & sample code
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  16. #696
    Addicted Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Posts
    242

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Quote Originally Posted by LaVolpe View Post
    Cropping? Start on page 7, post 245. Read that one and the next few. There are a couple options & sample code
    i used your code :
    Code:
         With tmpimg
            .SetRedraw = False
            .AlignCenter = False
            .AutoSize = lvicNoAutoSize
            ' ensure X, Y are pixel scalemode
            .SetOffsets -0, -0
            ' ensure X, Y, Width, Height are appropriate container scalemode
            .Move .Left + 0, .Top + 0, .Width - (70 * Screen.TwipsPerPixelX), .Height - (70 * Screen.TwipsPerPixelY)
            .SetRedraw = True
        End With
    
        myloader.SavePictureGDIplus tmpimg.Picture, SavePath, lvicSaveAsPNG

    i changed that line to :
    Code:
            .Move .Left + 0, .Top + 0, Width - 70, Height - 70)
            'or 
           .Move .Left + 0, .Top + 0, 3000, 3000)
    but saved as orginal size alltimes,why?
    i want saved croped image for example from 300*300 orginal pixel to 230*230pixel as png

  17. #697

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,536

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Try to better understand the control you are using. That code crops the image within the display, it is not editing the image, is it? If you would have did as I asked and read the next few after post #245, you would have seen an example of creating a cropped image that you can save.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  18. #698
    Addicted Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Posts
    242

    Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

    Quote Originally Posted by LaVolpe View Post
    Try to better understand the control you are using. That code crops the image within the display, it is not editing the image, is it? If you would have did as I asked and read the next few after post #245, you would have seen an example of creating a cropped image that you can save.
    i used wia like as this for crop png file (my problem fixed now) :

    Code:
        Dim img  As New WIA.ImageFile
        Dim IP   As New WIA.ImageProcess
        img.LoadFile orginalfilename
        IP.Filters.Add IP.FilterInfos!Crop.FilterID
        IP.Filters(1).Properties("Left") = 0
        IP.Filters(1).Properties("Top") = 0
        IP.Filters(1).Properties("Right") = 0
        IP.Filters(1).Properties("Bottom") = 70
        IP.Filters(1).Properties("FrameIndex") = 0
        IP.Apply(img).FileData.ImageFile.SaveFile "path and png file name"

Page 18 of 18 FirstFirst ... 815161718

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