invalidation

invalidate() doesn't recall OnDraw method

时光毁灭记忆、已成空白 提交于 2019-12-08 11:33:32
问题 invalidate() doesn't recall my OnDraw() method. I use invalidate() in a setter method in the same class that OnDraw() is in. public class PuzzleDraw extends View { // defining some variables // protected void onDraw(Canvas canvas) { super.onDraw(canvas); // codes for painting puzzle // } public PuzzleDraw(Context context) { super(context); } // Method for giving cursor X/Y from MainActivity OnTouch() method and using it in OnDraw() method in some part of painting code // public void setCursor

problem with calling invalidate in async task thread in Android !

随声附和 提交于 2019-12-07 18:35:18
问题 I am trying to call the invalidate() from asyntask thread. I am getting this error : 10-18 15:14:30.469: ERROR/AndroidRuntime(889): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. The line I have used is : mainClass.myMapView.invalidate();//where mainClass=main UI class Can anyone kindly suggest where my fault is ? Thanks. - ahsan 回答1: You can't do anything UI-related from a different thread than the

Onpaint events (invalidated) changing execution order after a period normal operation (runtime)

China☆狼群 提交于 2019-12-07 17:38:40
问题 I have 3 data graphs that are painted via the their paint events. When I have data that I need to insert into the graph I call the controls invalidate() command. The first control's paint event actually creates a bitmap buffer for the other 2 graphs to avoid repeating a long loop. So the invalidate commands are in a specific order (1,2,3). This works well, however when the graphed data reaches the end of the graph window (PictureBox) where the data would normally start scrolling, the paint

C# Invalidate is not calling paint method

此生再无相见时 提交于 2019-12-07 03:19:28
问题 I have OnPaint method overrided to draw an Ellipse on the screen. protected override void OnPaint(PaintEventArgs e) { MessageBox.Show("Paint"); if (debugStarted) { int y = rtbLogicCode.PlaceToPoint(new Place(0, debugLine)).Y; if (rtbLogicCode.GetVisibleState(debugLine).ToString() == "Visible") { e.Graphics.FillEllipse(new LinearGradientBrush(new Rectangle(0, y, 15, 15), Color.LightPink, Color.Red, 45), 0, y, 15, 15); } base.OnPaint(e); } } private void rtbLogicCode_Scroll(object sender,

How to update Android Views upon modifications?

牧云@^-^@ 提交于 2019-12-07 00:12:19
问题 I have some methods in my View that modify some of the shapes that are drawn when called. In Java in order to make sure the component is updated I would call repaint() . Is there something that will make sure my view is updated correctly? I had read somewhere that calling invalidate() in the onDraw() method would keep things up to date and therefore I wouldn't need to have something like repaint() in my methods that modify that shapes that are drawn. Is this correct, or is there something

Invalidate the whole output cache in asp .net MVC 2

[亡魂溺海] 提交于 2019-12-06 14:48:36
How is it possible to invalidate the whole output cache in asp .net mvc 2? AFAIK this is not possible. You can only invalidate specific actions that might have been cached by decorating them with the [OutputCache] attribute. HttpResponse.RemoveOutputCacheItem(Url.Action("Index", "Products")); While I don't know if there is a way to do it in code, still recycling the worker process might invalidate the server cache. If this is true then you might even do it in code by having code to do the recycling. 来源: https://stackoverflow.com/questions/4782569/invalidate-the-whole-output-cache-in-asp-net

Problem with invalidation of STL iterators when calling erase

走远了吗. 提交于 2019-12-06 05:45:48
问题 The STL standard defines that when an erase occurs on containers such as std::deque, std::list etc iterators are invalidated. My question is as follows, assuming the list of integers contained in a std::deque, and a pair of indicies indicating a range of elements in the std::deque, what is the correct way to delete all even elements? So far I have the following, however the problem here is that the assumed end is invalidated after an erase: #include <cstddef> #include <deque> int main() { std

iText Stamping - Java [duplicate]

孤人 提交于 2019-12-06 05:39:45
问题 This question already has answers here : how to add blank page in digitally signed pdf using java? (2 answers) Closed 4 years ago . I am having trouble with stamping PDF documents without invalidating digital signatures. Current, I succeeded stamping a PDF. However, if the document is previously signed the signature is no longer valid. I understand why that happens, but if I use Acrobat to add text or stamp it using annotation, the signature is valid. I tried adding annotations or comments

Refresh / Update WPF controls like win forms

隐身守侯 提交于 2019-12-05 07:21:46
问题 changing the text of a label (or sophisticatedly we can say a text-based progress bar). in winforms you just Invalidate / Update. But how to do this in WPF without using Background Threads. ??? 回答1: public static class ExtensionMethods { private static Action EmptyDelegate = delegate() { }; public static void Refresh(this UIElement uiElement) { uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate); } } private void LoopingMethod() { for (int i = 0; i < 10; i++) { label1

How to update Android Views upon modifications?

拈花ヽ惹草 提交于 2019-12-05 05:27:27
I have some methods in my View that modify some of the shapes that are drawn when called. In Java in order to make sure the component is updated I would call repaint() . Is there something that will make sure my view is updated correctly? I had read somewhere that calling invalidate() in the onDraw() method would keep things up to date and therefore I wouldn't need to have something like repaint() in my methods that modify that shapes that are drawn. Is this correct, or is there something else I have to do? EDIT To add in an example, a method I call in my view is: public void setLineThickness