Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen Snapshot
#1
I have modified Gintaras 'magnifier' - and improved a little.
Also would like to make some memory functions and save to file.
I'm working on a new member function '__MemBmp.Copy' to make a copy of BMP object, but not shure how to do,- maybe Gintaras will help.
Updates will follow...

Joergen


Attached Files
.qml   Snapshot.qml (Size: 1.67 KB / Downloads: 325)
#2
CopyImage copies bitmap.
#3
Here is a new version of my 'Screen Snapshot' project with great improvements.
Zoom in/out by pressing LBUTTON and drag up/down.
Shooting can be disabled by click on text in the statusbar.
Also window can be resized, and image will be centered automatically.

Memory function will have to wait a little, i have to take a look at 'CopyImage'.

Joergen


Attached Files
.qml   SnapShot_2.qml (Size: 3.69 KB / Downloads: 307)
#4
Hello Gintaras
This was very easy!
I'm not quite sure, that it's done by the book, but it works!

But the text 'Delete' that is found in '__MemBmp.Create', what is it good for?

Joergen

function __MemBmp't_mb

Delete

dc=CreateCompatibleDC(t_mb.dc)
bm=CopyImage(t_mb.bm IMAGE_BITMAP 0 0 0)
oldbm=SelectObject(dc bm)
#5
It is __MemBmp member function. If the object is already initialized, deletes old bitmap and dc.
#6
Memory functions are almost ready, but i had one problem with the __MemBmp.Copy member function
Original bitmap was deleted after copying,- solution is to only pass adress of __MemBmp...

function __MemBmp*t_mb

Delete

dc=CreateCompatibleDC(t_mb.dc)
bm=CopyImage(t_mb.bm IMAGE_BITMAP 0 0 0)
oldbm=SelectObject(dc bm)
#7
Quote:Original bitmap was deleted after copying

Because __MemBmp does not have operator=. Then QM copies each member variable. It does not know that it is bitmap handle or dc, and copies it like a simple int variable.

Most classes in System folder don't have operator=. Objects of some of these classes must never be assigned by value. & or * is OK.
#8
Ok,- i think i understand.. hmm..
But here is again a new version with 3 memory banks.
Copy to memory by pressing LBUTTON for about 0,5sec.
Also zoom level and offset is individual, but set to 0 when copying.


Attached Files
.qml   SnapShot_3.qml (Size: 5.31 KB / Downloads: 312)
#9
Copy() is similar to Attach(). Can make shorter.

Member function __MemBmp.Copy
Code:
Select All      Help
function __MemBmp*t_mb

Attach(CopyImage(t_mb.bm IMAGE_BITMAP 0 0 0))
#10
Error when you press left mouse button on the dialog before you press shift.
Error (RT) in "dlg_snapshot /1941"odlg_snapshot: exception

-----------

When dialog is minimized and then restore, sometimes, you must move or resize dialog to show memory.

--------
Very nice job!
#11
Bugs are fixed and attached file updated.
Exception was caused by a division by zero..
Thanks for testing my project !


Forum Jump:


Users browsing this thread: 1 Guest(s)