I have a GUI with some QLabels which have a PNG image / pixmap each. When I set a process to perform I also added self.parent.setEnabled(False) and self.setEnabled(False) so that the user cannot interupt the process. However, the pixmap images turn grey and I would like to set them so that they stay as they are without a grey cast on them. How is this possible? Would a stylesheet be the solution?
My code to disable user interaction during the process is:
def playVideo(self):
global app
app.setOverrideCursor(QCursor(QPixmap("./imgs/cursor.png")))
self.parent.setEnabled(False)
self.setEnabled(False)
Many thanks for any help in this.
Related
I'd like to have a background image in the NSSavePanel which I need to satisfy macOS Sandbox file export requirements. Such background image would be reflective of the overall imagery I use in the other application window and sheets. Apple's default NSSavePanel image style is okay for an app that cares little about its style, but my app is directed to video editors who can appreciate an artistic rather than mechanical atmosphere.
I've been able to use the panel's accessoryView property but it only appears as a differentiated section in the panel separate from the panel's overall style.
A simple background image for the panel overall capability would completely suffice, but it doesn't seem possible according to all the Apple Developer documentation. Maybe there's a practical HACK?
In certain programs and applications, when I looked at their installation files they had some images only a few pixels say 40px in height and 1px in width.
I learned from that time that image files are used seamlessly to create textures for certain parts of their programs "window" or "form".
I would like to know how to recreate this in visual basic. Let's take a simple example to use: I have a panel and inside this panel I want the seamless texture to repeat so that when the user re-sizes the form the image isn't cropped or not visibly stretched.
Also take the example of the image below showing the title bar in iTunes.
(I have already tried searching examples of this, but I don't know what the method is called and online results focus mainly on the words "seamless" and "design", showing things like Illustrator)
Background image in Tile or Stretch mode
I have about 400 pdfs with a lot of dead space between the text and the page border.
Usually I'm using govert's pdf cropper to crop all the whitespace, but this time the pdf background color is (darn!) yellow,
and no software which I know (and I've searched for quite a while) can crop non-whitespace
(well, except maybe pdfcrop.pl -a Pearl library which supposedly can remove black spaces).
Anybody knows of a software that can perform such task?
The ideal app, I guess, would have the option to receive specific color to remove,
like rgb(192,192,192).
Thanks in advance.
The reason this is so difficult is that PDF has no concept of paper color or background color. So what you're seeing is not a different background color, but an object (typically a rectangle) painted in that yellow background color.
Most cropping tools simply calculate the bounding box of all objects on the page and then crop away everything outside that bounding box. Of course that doesn't work for your file because the bounding box will include the background rectangle object.
There are potentially a number of directions you could take this:
1) If all pages need to be cropped by the same amount, you could attempt to do cropping that way (simply passing a rectangle to the cropping tool to do the actual cropping).
2) There are tools (callas pdfToolbox - watch it, I'm associated with this tool, Enfocus PitStop...) that allow you to remove objects from a document and this could be done by specifying your yellow color. This would allow you to modify the PDF file by removing the background object and then perform the cropping you want to perform.
I'm trying to "load" some 2d image as a material for a mesh, (I know about spritemanager) but I'm unfortunately getting this sprite with it's white background. How can I "make it go"(the background)?
Thanks.
If the image is of a file type that supports transparency, open it up in image editing software (paint.net, photoshop, etc.) and delete the white or replace it with empty/transparent color.
Otherwise, look for an option in the unity documentation to set a specific color value as 'background' or 'transparent' so that that color will be ignored.
First of all, you need to add an alpha channel to your texture and save it in a format that supports alpha channel transparency.
Here is a quick tutorial on how to do this in GIMP:
Note that you can remove the selected background with the Delete-key.
In my case, I'm exporting the result as a PNG for alpha transparency support. You can do this from the export menu by renaming the file suffix to .png:
I use these settings to export my PNG:
Then, after importing the image into Unity, Make sure that in the texture's import settings the image's alpha source is set to Input Texture Alpha and that Alpha is Transparency tickbox is checked like so:
Finally, since you are using this on a mesh, you need to ensure that your mesh has a material applied that has it's render mode set to Cutout:
Hope this little guide helps.
I have a Window (Win32 API) Application in Visual C++. I am not using MFC. I have to create a round/circular button with bitmap image. My application have a skinned view. Can any one help me out in achieving this task.
Buttons are windows. You can create a button with the CreateWindow or CreateWindowEx call:
-http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx
When you create your button window ensure that you pass the BS_OWNDERDRAW style:
-http://msdn.microsoft.com/en-us/library/bb775951(VS.85).aspx
That will tell the button to send WM_DRAWITEM messages to your buttons' WNDPROC:
-http://msdn.microsoft.com/en-us/library/bb775923(v=VS.85).aspx
In your buttons' WNDPROC you would handle the WM_DRAWITEM message and paint your button according to the information in the DRAWITEMSTRUCT received as a pointer in lParam.
To render a bitmap as anything but rectangular you will need to provide a 1-bit bitmask bitmap the same size as the bitmap you wish to render for your button. The bitmask has bits set where you want the pixels in your button bitmap to be set on the screen. The pixels in your button bitmap that do not display need to be black. Bitblt your bitmask bitmap to the screen with the AND operator then OR your button bitmap. Of course you will need to account for the various button states (normally a push button is only two states.)
I may have mixed the black/white or set/unset bits in the explanation above, but the AND / OR bitwise (SRCAND/SRCPAINT) Raster Operations are the correct operations for what you are trying to acheive.
-http://msdn.microsoft.com/en-us/library/aa930997.aspx
Hope that helps.
You can google to find techniques for BitBlting images using memory DC and various ROP2 settings to achieve a masking effect. Your round image that represents the button would use a specific color to represent transparency. I don't have the specific code at hand but it is non-trivial.
The key api call you need to know is SetWindowRgn. This is what you call to tell windows that the the window is not rectangular but an irregular region. If you google around for that, you will find lots of sample code.
One promising example is this project. It does depend on MFC, but you can use it to learn what you need to call in what order to get the desired effect.