Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mask image: QBitmap?, C-style arrays? or something else?
Qt 6.11 is out! See what's new in the release blog

Mask image: QBitmap?, C-style arrays? or something else?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 600 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    isaacEnrique
    wrote on last edited by
    #1

    Greetings .

    I'm writing a tool that , among other things, displays an image and allows the user with the mouse to highlight areas of interest (drawing rectangles) on that image.

    These rectangles drawn once can be resized by the user (using the mouse). Thus, when the mouse cursor is located on a corner (or the midpoint of one side ) of any of the painted rectangles, the cursor changes shape and allows the user to resize the rectangle .

    Each time the mouse moves over the image, I need to know if the point where the cursor is located corresponds to one of the corners (or one of the midpoints of each side) of one of the painted rectangle . To do this so fast , I intend to use an image (0s and 1s) that serves as a mask.

    Initially I thought of using the QBitmap class (to save memory) , but apparently this class does not allow direct access to each position or pixel. Now I'm not sure that I use: A two-dimensional array in C style?, QVector? or is it something else?

    Thanks in advance for any help and/or suggestions.

    Isaac Pérez
    Programming is understanding.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved