Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Accessing of Canvas of DC as DIB Posted by tajmadhu on 1 Jul 2009 at 10:45 PM
hi all,

This is Madhu Sudhan Reddy. I am loading the bitmap using TImage into the memory. Let the bitmap size is 1000*1000 and TImage width and height are 500*500. while displaying the image (loaded bitmap) to the TImage some of the bitmap only can appear because of insufficient TImage width and height. Now I want the displayed area (500*500) of the TImage as a DIB. Is there any way to get the canvas pixels as DIB.

My main problem is that, on the image I want to draw some selections (as in photoshop) like rectangles, lines, lasso etc.,. Using the DIB of the image I am changing the image data later I am stretching image to the TIMage and forcing to repaint. Since I directly changed the image data for drawing selections, while "Zooming In" my selections also doubling along with Image, because image actual data only is used to "zoom in" the image.

For every zoom operation (+ or -), first TImage prepares the data to be stretched to the TImage display window from the actual image data. After preparing the data to be stretched and before stretching to the window, if I get this memory as a DIB I can modify this memory according to my selections data(rectangle, line, lasso, etc.). Here we are not changing the actual image memory and we are modifying the stretchable memory. By doing some correlate calculations I write my selections data to the stretchable memory so no doubling of my selections data.

Is there any way to access the stretchable memory as a DIB. And when we can know that the window is going to refresh.

Regards
Madhu Sudhan Reddy



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.