954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

BCB 6 Timage canvas refresh/redraw

Hi,

I have a Timage on a panel and I want to draw a cross on the image as I move my mouse on the image. I am drawing the cross using the canvas of the image. The drawing of the mouse works fine but the problem I am encountring is that when I move the mouse again the previous cross that was drawn is still there. I have tried to refresh the Image and the canvas but that hasn't helped. Any suggestions...

Thanks in advance.

nu2cpp
Newbie Poster
20 posts since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

TCanvas is something like HDC (wrapper on it).
When you begin to draw cross or something you want, you may fill full client area of TImage with background color.
Use method FillRect of TCanvas class.

Asat232
Newbie Poster
17 posts since Apr 2008
Reputation Points: 10
Solved Threads: 2
 

what libraries, compiler, and operating system are you using to do all that drawing? If you want the previous cross to disappear when you move the mouse you will have to redraw the cross in the same color as the canvas background. It doesn't disappear on its own.

[edit]Or, more likey what ^^^ he said [/edit]

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Don't forget to make call of Update method of TImage class after all.

Notes:
BCB 6 is Builder C++ Version 6.
TCanvas is builder class, like CDC in MFC.

Asat232
Newbie Poster
17 posts since Apr 2008
Reputation Points: 10
Solved Threads: 2
 
TCanvas is something like HDC (wrapper on it). When you begin to draw cross or something you want, you may fill full client area of TImage with background color. Use method FillRect of TCanvas class.


Thanks,

This worked fine. I should have tried this earlier but just thought that there was a another way. What a waste of time. This was such an easy fix.

nu2cpp
Newbie Poster
20 posts since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You