In my app, I want the status bar visible using transparent black. I want my framebuffer to be the same size as the device's screen, and I want touch input at (0,0) to be at the top-left corner of the DEVICE, not right under the status bar.
As it is now, EAGLView is initializing the framebuffer to 320x460, so I can't draw anything for the status bar to be transparent over. Also, if the user taps the top-left of the screen, the touch position is given to me as (0,-20), whereas I want (0,0).
My questions are:
1. What's the right way to make EAGLView initialize the framebuffer to the full device screen size?
2. Why is my input offset so (0,0) is under the status bar? How do I fix it?
What I'm doing now is forcing Layer.Bounds to 320x480 in ConfigureLayer. That gets the framebuffer to be the right size, but if I set EAGLView.Bounds or EAGLView.Layer.Bounds to anything, it gets reset to 320x460 constantly.
The fix here was to set ViewController.WantsFullScreenLayout = true. Without that set, it keeps auto-resizing the view to sit under the status bar.
Related
I want to make a splash screen that appears when i open the app and disappears after 3 seconds, with the image being shared with the next activity.
On smaller screens(for example Pixel 2) the animation works without problems, but when i try it on my OnePlus 6 or Pixel 3 XL, the image always clips to like 50dp below it's position right before the transition.
What could be the problem?
For anyone having the same problem.
The issue was that i was setting a color on the splash screen's frame background. If i didn't set any color, it would work fine.
I found a way around it by adding a view that expanded the whole screen and setting the color to the view instead.
I hope this will help someone eventually.
I'm trying to display a number on a board with lines (go game). Right now, the number is displayed on top of a cross, so it's not very easy to tell. See the screen shot below
The background is drawn with setBackgroundBrush() on the scene.
The lines are QGraphicsLineItem which are added to the scene after the background.
I've tried to display a small portion of the background below the number but the effect isn't great. Is there a smart way of doing this so that when the number is displayed, the area that's covered by the number only shows the background texture and not the lines?
I got a RGB332 LCD and a poor MCU to drive it . The MCU do not have a hardware accelerator nor do RGB332 display support an alpha path.
So I used the color "black" as a "alpha color" to deal with icon paste work.Which means I fill the icon color data to background buffer while the data is not black.
The problem I meet is that the icon showed it's own antialiased edge while the background is not black. And the "antialiased edge" just makes an edge effect from the background.
Is there any way to deal with the situation ?
The main problem is that I don't have "Layer" and "Alpha" to do the PS-like merge work.
But the Icons are Pasted to a Frame buffer one by one.
So my solution is :
When each icon is being pasted,I could decide the front/background,
which means I could detect the "antialiased edge" of the icons just
like I have "layers".
After I find the antialiased edges ,I filled the pixels with the
middle color of the front/background.
The LCD is RGB332,and the middle color calculation is just filling
the edge with 75% background color + 25% front color. If the icon
color is carefully designed, you don't even need a float calculation
.
The work maybe not that effective ,but really solved my problem.
I would like to implement red lines moving oh H/V rulers similar to what I see in windows paint brush (8.1) indicating current mouse position. See the example (red line at 560):
What would be the best way to do it. Direct2D Animation? layers? any other simple trick? The thing here is of cause doing it efficiently without repainting the whole area on mouse move.
I currently using MFC/direct2d so I paint myself the area with field and rulers inside the view, so I have full control on graphics here.
There are many ways to attack this problem. The simplest is to rely on your OnPaint function to paint the line in a location based on a member variable. In your OnMouseMove handler, call InvalidateRect on the current location of the line based on the saved variable, update the variable, and call InvalidateRect a second time for the new line position.
The BeginPaint call that is generated in the CPaintDC constructor will set a clipping region based on the invalidation rectangles you provided. Even if your OnPaint tries to paint the entire window, only those parts that have been invalidated will be redrawn. If this is too inefficient, you can cache the ruler in a bitmap and use GetClipBox to determine which part of the bitmap to blit to the screen.
Hia.
I am using some round rect buttons with own images for their states. Each time am displaying a different view for some stuff, the buttons become white and my images are fading in briefly later.
The problem occurs only with the UIModalTransitionStyleCrossDissolve animation.
The other 3, UIModalTransitionStyleCoverVertical, UIModalTransitionStyleFlipHorizontal and UIModalTransitionStylePartialCurl, don't show this effect.
The effect would be ok, ok if the starting color would be black. I didn't find any way to change that color in IB. Where does it come from? Any idea?
Tried to set the background over the inherited properties of UIImage, but he simply ignored it. Switching the Round rect button to a custom one solved it. Leaves the question what to do if I want a round rect. A black background image didn't help. He seems to use the background color to fade.