paint

English characters don't show up when entering text with Urdu fonts in Swing

谁都会走 提交于 2019-12-02 05:11:55
问题 This is similar to my own previous question, but that solution didn't work here. As mentioned in the previous question, I'm working on a cross platform(Windows/Ubuntu) application that has to transliterate English into one of several official Indian languages. The application has a custom input method, and typing in English and pressing space will transliterate the typed text into the specific local language. Urdu is different from the others in being right to left, like Arabic/Hebrew. I

Qt: QPainter + GDI in the same widget?

不想你离开。 提交于 2019-12-02 04:30:37
I'm trying to use the method described here to use a QPainter and GDI calls on the same widget. Unfortunately this tutorial seem to have been written on an earlier version of Qt and now it does not work. I set the WA_PaintOnScreen flag and reimplement paintEngine() to return NULL. Then on the paintEvent() I create a QPainter, use it and then use some GDI calls to paint a bitmap. The GDI calls work fine but the QPainter does nothing. I get the following error on the console: QPainter::begin: Paint device returned engine == 0, type: 1 Is this simply not supported anymore? how can I do it? I've

Add transparent JPanel upon AWT Component to paint on

不想你离开。 提交于 2019-12-02 04:27:02
问题 I've got a Problem: In my Java application I've got an AWT Component (cannot change that one) that streams and shows an avi-file. Now I want to draw upon this movie and thought about putting a transparent JPanel above it and draw on that one. This does not work since I either see the avi-stream or the drawn lines but not both. I read somewhere that AWT does not support transparency of components - but the panel is a JPanel which is able to do so. Can someone please help me with this one -

Java full screen background color wont change?

跟風遠走 提交于 2019-12-02 04:08:30
I have some code that creates a full screen icon in java and sets the background color to pink and the foreground color to red. However every time i run it, it never changes the background color to red but just keeps it see through. I put the code below. The main java: import java.awt.*; import javax.swing.*; @SuppressWarnings({ "serial" }) public class bob extends JFrame{ public static void main(String[] args) { DisplayMode dm = new DisplayMode(800,600,16, DisplayMode.REFRESH_RATE_UNKNOWN); bob b = new bob(); b.run(dm); } public void run(DisplayMode dm){ setBackground(Color.PINK);

English characters don't show up when entering text with Urdu fonts in Swing

点点圈 提交于 2019-12-02 03:40:46
This is similar to my own previous question , but that solution didn't work here. As mentioned in the previous question, I'm working on a cross platform(Windows/Ubuntu) application that has to transliterate English into one of several official Indian languages. The application has a custom input method, and typing in English and pressing space will transliterate the typed text into the specific local language. Urdu is different from the others in being right to left, like Arabic/Hebrew. I managed to find an open licensed Urdu font that has both English and Urdu glyphs, but when I type

android - how to set custom typeface in paint object?

放肆的年华 提交于 2019-12-02 02:54:59
I want to use a Paint to draw something and here is my code : Paint mMonthTitlePaint = new Paint(); mMonthTitlePaint.setFakeBoldText(true); mMonthTitlePaint.setAntiAlias(true); mMonthTitlePaint.setTextSize(MONTH_LABEL_TEXT_SIZE); mMonthTitlePaint.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/iran_sans_.ttf")); mMonthTitlePaint.setColor(mDayTextColor); mMonthTitlePaint.setTextAlign(Align.CENTER); mMonthTitlePaint.setStyle(Style.FILL); but it is not working and typeface did not apply to paint object. where is my problem? how to fix it? here is my onDraw : @Override protected void

Add transparent JPanel upon AWT Component to paint on

假装没事ソ 提交于 2019-12-02 01:17:30
I've got a Problem: In my Java application I've got an AWT Component (cannot change that one) that streams and shows an avi-file. Now I want to draw upon this movie and thought about putting a transparent JPanel above it and draw on that one. This does not work since I either see the avi-stream or the drawn lines but not both. I read somewhere that AWT does not support transparency of components - but the panel is a JPanel which is able to do so. Can someone please help me with this one - thanks in advance. The Mixing Light and Heavyweight Components article explains how this is handled only

Drawing Graphics Disappear in VB.net

早过忘川 提交于 2019-12-02 01:11:34
问题 I have a simple program that you can draw on the screen with FillEllipse and FillRectangle. My problem is that when you drag another window over even a small portion of the screen, that part will be erased. This happens when you drag the other window over, let go, and drag it back off. Is there any way to fix this? Dim MyFormObject As Graphics = Me.CreateGraphics Select Case shape Case "Ellipse" MyFormObject.FillEllipse(brush, e.X - CInt(brushWidth / 2), e.Y - CInt(brushHeight / 2),

Java - repaint(x, y, w, h) doesn't call paintComponent? (with SSCCE)

独自空忆成欢 提交于 2019-12-02 00:09:30
问题 I asked this before, but only theoretically, without an SSCCE. Now, I've created one, and the problem persists. I'd like to know why paintComponent is not called on repaint(x, y, w, h) , but is called on repaint() . Two classes: SANDBOX import java.awt.Dimension; import java.awt.FlowLayout; import javax.swing.JFrame; public class Sandbox { public static void main(String[] args) { JFrame f = new JFrame(); f.setMinimumSize(new Dimension(800, 600)); f.setLocationRelativeTo(null); f

Java - repaint(x, y, w, h) doesn't call paintComponent? (with SSCCE)

二次信任 提交于 2019-12-01 20:35:27
I asked this before, but only theoretically, without an SSCCE. Now, I've created one, and the problem persists. I'd like to know why paintComponent is not called on repaint(x, y, w, h) , but is called on repaint() . Two classes: SANDBOX import java.awt.Dimension; import java.awt.FlowLayout; import javax.swing.JFrame; public class Sandbox { public static void main(String[] args) { JFrame f = new JFrame(); f.setMinimumSize(new Dimension(800, 600)); f.setLocationRelativeTo(null); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setLayout(new FlowLayout()); // Add label f.getContentPane().add