Okay, instead of asking piece by piece, I am going to list all the canvas properties from win32 program that I am having problem with. What would you replace these with for Delphi Prism?
TPanelBevel
TFontStyles
TFontData
TDateTime
TColor
TBrushStyle
TAlignment
There is no Canvas in Windows Forms. There are some possible workarounds:
1.) You could start drawing on a Bitmap and display this Bitmap on your form. Here is an example for that (in C# again).
2.) You could use a WPF canvas in your Windows Forms application (create it within an System.Windows.Forms.Integration.ElementHost control) and use this.
Besides this, there is no direct way to work with a canvas-style element in .NET.
Related
I am writing a simple application with Python3, Gtk3 and Webkit2. One of the elements is a webview, but I want the webview to be transparent to the background set for the parent container - in this case a Gtk.Paned in a Gtk.Box where the GtK.Box can optionally have a background image set.
Most of the solutions I've found out there give you a webview that is transparent to the screen/desktop. Like this solution:
Is it possible to render web content over a clear background using WebKit?
This is not quite what I want. Is there any way to choose what webview is transparent to? Or another approach that produces the desired result?
Good question, but as far as I know it's not currently possible.
Just started working with this awesome external but have a couple of questions.
When the control is evoked, is it always the top layer or can I have a background transparent image on top of it so I can frame the control nicely?
Also, my testing seems to read most Barcodes but when it comes down to reading Barcodes on hard drives, the control does not want to decode those.... Too dense of bar code pattern?
I am very impressed thus far with the ease of use of your externals. Makes we want to code more for mobile devices!
an overlaying transparent image is not possible, as far as i know.
but couldnĀ“t you use
command mergZXingControlSetRect pLeft,pTop,pRight,pBottom
to define the rect of that scanner after creation
or
command mergZXingControlCreate pLeft,pTop,pRight,pBottom
to create the scanner control in the specified rect.
Set the rect smaller than the width and the height of the screen.
You could then use an underlying image, which is displayed outside of the scanner rect, to show the frame around scanner control. Did not test it myself, but i would assume that this should work.
Unfortunately the native controls in externals and the ones the engine provides are added as views on top of the LiveCode view. That means you can't intermingle LiveCode controls with them. One thing that some users have done is add a web view with a transparent background and a load a png image. If you create the barcode view first and the web view second then the web view will be on top.
I have to draw a transparent square, that never disappears from the user's interface, by clicking to other windows the rectangle remains, only the windows/application content has to be shown behind.
I have thought of doing it with OpenGl or Flex or Canvas , but the problem is whenever I click on another window the programmed rectangle disappears .The rectangle has to act as a default image but has to be always at the foreground.
Do I have to mess with the operating system(Linux, Mac or Windows), by creating this image as default?
here is one example
http://i42.tinypic.com/15g3vxh.png
You can do that with Java pretty easy. See this link for code examples. If you got your transparent Image, you can use the setAlwaysOnTop(true); Method on the Object, and you are good to go. The only things that could get in front of that are other Applications that are using that method.
I'm trying to understand how does Office 2013 - the part where it draws content to the screen. My findings to far:
Office is creating a Wic based bitmap, using CreateWicBitmapRenderTarget.
Using this Render Target, Office uses various drawing methods. It wraps those calls with BeginDraw/EndDraw as expected.
Office uses DrawGlyphRun method to draw the text of the document on the Wic bitmap (i.e. the This pointer of DrawGlyphRun is the one returned from CreateWicBitmapRenderTarget).
At this point I'm confused how Office continue. So my question is:
What are the various possible ways to copy a Wic based Render Target to the screen?
I'm pretty sure that at the end, Office is using a swap chain (probably craeted with CreateSwapChain on Windows 7 and CreateSwapChainForHwnd on Windows 8). I'm stepping through various "suspicous" functions such as CreateBitmapFromWicBitmap and CreateBitmapFromDxgiSurface) - but I don't understand the complete chain of API calls.
EDIT (answer to MooseBoys):
This is NOT a general question for putting pixels on the screen. The pixels are already on one RenderTarget (A render target that was created with CreateWicBitmapRenderTarget, and then has been drawn with BeginDraw/DrawGlyphRun/EndDraw) and I now want to move those pixes to another RenderTarget (a render target on the actual screen).
On the GDC world, I would look for something like BitBlt, to move pixels from one hdc to another. I wonder what is the protocol in the D2D world.
I am working on a very large MFC application. There are hundreds of dialogues in this application. Now, I want to change the Background color and Font size of all dialogues in MFC application. How can I do this? Whether I have to handle WM_CTLCOLOR massage for each and every dialogue or any other work around?
Note: I can not use any library like BCGSoft, Xtreme Toolkit.
Create a Dialog class and handle WM_CTLCOLOR massage in that class, Now derive every other Dialog of your MFC application from this class.