Results 1 to 5 of 5

Thread: Some questions regarding image manipulation (.net -> QT)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Some questions regarding image manipulation (.net -> QT)

    Hio, i just started with QT and I want to port some of my stuff from win to mac.

    But currently I'm a bit stuck at this point:

    I use lockbits in vb.net to get the most speed to manipulate images (as far as I know this should be the fastest way in vb.net). This is a small example how to invert an image

    Qt Code:
    1. Public Shared Function Invert_Image(ByVal doImage As Bitmap) As Bitmap
    2.  
    3. Dim imageData As BitmapData = doImage.LockBits(New Rectangle(0, 0, doImage.Width, doImage.Height), _
    4. System.Drawing.Imaging.ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb)
    5.  
    6. Dim pointer0 As IntPtr = imageData.Scan0
    7. Dim stride As Integer = imageData.Stride
    8.  
    9. Dim pixels(doImage.Width * doImage.Height - 1) As Integer
    10.  
    11. Copy(pointer0, pixels, 0, pixels.Length)
    12.  
    13. For i As Integer = 0 To pixels.Length - 1
    14. pixels(i) = (Not pixels(i) And &HFFFFFF) Or (pixels(i) And &HFF000000)
    15. Next i
    16.  
    17. Copy(pixels, 0, pointer0, pixels.Length)
    18.  
    19. doImage.UnlockBits(imageData)
    20.  
    21. Return doImage
    22. End Function
    To copy to clipboard, switch view to plain text mode 

    And this is the point where my questions starts...is there a similar way to manipulate images in QT?
    I've read the documentation for QImage but I still don't understand wether QImage got something like this lockbits or wether QT got maybe some even faster methode.

    Would some one clarify this to me maybe with some small example?

    Thx in advance
    freitag
    Last edited by freitag; 8th May 2010 at 08:14.

Similar Threads

  1. Image sequence Questions...
    By Deep Thought in forum Qt Programming
    Replies: 5
    Last Post: 12th February 2016, 10:23
  2. Background manipulation of QPlainTextEdit
    By djjkotze in forum Qt Programming
    Replies: 1
    Last Post: 3rd May 2010, 13:34
  3. String manipulation methods?
    By PaladinKnight in forum Newbie
    Replies: 5
    Last Post: 16th March 2010, 23:44
  4. QString manipulation - QRegExp
    By mattia in forum Newbie
    Replies: 1
    Last Post: 18th March 2008, 11:21
  5. Replies: 3
    Last Post: 14th March 2007, 08:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.