How to place text on top of image in ReportViewer - image

I feel very silly asking this, since it seems like it just should work, but I cannot make it work and cannot find anything in the documentation about this.
The problem: I'm developing an application in Visual Studio 2010 that is utilizing ReportViewer, rendering the report locally. In the report designer, I place a textbox on top of an image. This looks fine in the designer, but when rendering the report, the textbox is rendered below the image.
Now, before you suggest it, I have tried placing a textbox on top of a rectangle (or other control) with the BackgroundImage property set. This works. But: I cannot find a way to rescale the background image to fit the control. Setting a different dpi for the background image does nothing. Simply rescaling the image to a different resolution is not an option, since I eventually want to print the report.
Does anybody have a solution to this?

Not possible unless the image and text are rendered separatly.
Just think of the reporting service as a matrix such as excel and only one item can be in each space. This is also true as when the report is rendered it is realigned acordingly.

Related

Best way to represent list with image(using url) in Xamarin.Forms?

I want to create List View. In this List View, I will have following fields.
StackPanel
1- Image with 300 x 400 size
2- Text-Label Controls
1 Screen will hardly cover 1 and Half ViewCell.
Images will have ImageURL. I want to load image smoothly. I also want to make smooth scroll up/down with image appearing.
Can anybody please suggest me which control I should use?
If List View, which CacheStrategy I should use?
Note: For one of such functionality, I had used List View with default CacheStrategy. In that, I just faced 1 major problem of image appearing. When page initialize first time, it show image properly. But as soon as I scroll down or scroll up, image disappear or misplace. In that case, I had suffered a lot and removed image finally.
Please suggest appropriate way for above functionality.
Thank you.
For the listview, you should definitely use RecycleElement as the CachingStrategy. See here https://developer.xamarin.com/api/type/Xamarin.Forms.ListViewCachingStrategy/#Remarks
And because the images are URLs, you can use FFImageLoading. It will fade-in the image after it is downloaded (as opposed to appearing instantly after downloaded), and you can even specify a placeholder image to use while the image is being downloaded.

Mac Rounded Texture Button with custom image on inactive window

I can see that most apps use Rounded Texture Button for Toolbar commands on macOS. However I can't make those buttons look fully native if I use a custom image (vector or bitmap). The problem is that if the window is inactive, image is still painted the same and not semi-transparent. This works fine if I use the system provided images, so my guess is that it has something to do with the image definition, but I have tried various things (like using Assets or Resources, using vector and bitmap images) and still no success. As said I guess it is something simple, but hard enough that I can't find it, can anyone help?
You need to set the image as template image. Only then AppKit is able to render the image correctly in every circumstance.

Creating an image for a Visual Basic command button?

I'm working on an application which was made in Visual Basic 6.0. It was been made 8-10 years ago. There are different images used on the different command buttons. I have made a new image for a new button, but the image is not matched with the other images and I don't want to change all the old images.
I have used Fireworks 8.0, MS Office Picture Manager and MS Paint. However, I have failed to make the image the same as the others. I have attached a screen shot of the application. The new image is highlighted in a red rectangle. I want all the buttons to look the same. The new image looks a little blurry; also, the font is smooth, which it shouldn't be because the others aren't smooth.
I have faced similar issue. I have tested the text of the image with some of the fonts and found that MS Sans Serif was matched with font of the other images. I wrote the text in MS-Paint then copied it and paste it with icon in Fireworks 8 and made the background transparent. It worked for me. You can try it. Hope this helps!
You just have to try to make your images look like the previous images.
Try to find out which font was used. Turn off anti-aliasing in the image editor - that might be why the text looks smooth.
Perhaps you are drawing your image rather larger than the space available in the buttons, and then it is being shrunk to fit at runtime? That could make it look blurry. And have you used more colours than the other images? And more "subtle" colours, but the colours in the other images are quite brash.

Working with a Custom Image Grid

I was looking for a custom image grid and found a similar question that had a really sweet component in an answer.
I downloaded the code and after some fiddling, I managed to get it to compile in DXE2. It looks really cool, but I can't get either scrollbar to show up. I also can't figure out how to dynamically control the images displayed. Or how to update the grid based on keyboard events.
Also, to get it to compile I had to remove the GR32 references; the library I downloaded had too many incompatibilities with DXE2 for me to resolve.
Any help would be greatly appreciated. This really looks like a killer component.
Update from Bill:
Here is a screenshot of incorrect thumbnail painting. I can not get the thumbnails to look like the screenshot from the component in question.
If the thumbnails were painted at the same XY as the rects painted in the first pass they would look much better. Any idea on what is going on?
... but I can't get either scrollbar to show up.
Well, there is no horizontal scrollbar. There is the property ColWidth that controls how much images are drawn in one row, depending on the control's width. You might update ColWidth in an OnResize event handler due to anchor settings, for example.
The vertical scroll bar appears automatically when not all images (incl. spacing) fit in the clientrect. The images are drawn on a TPaintBox and that paint box' size is updated as soon as the image count changes:
procedure TImageGrid.RearrangeImages;
begin
...
FPainter.Height := Max(ClientHeight,
FRowCount * (FRowHeight + FImageSpacing) - FImageSpacing);
The component inherites from TScrollingWinControl, so the scroll bar should modify accordingly. If not, then Bill has a workaround found as commented:
VertScrollBar.Range := FRowCount * (FRowHeight + FImageSpacing) - FImageSpacing;
I understand this obviously also works, but I really wonder why the scroll bar's range should be modified manually. Here in D7 I have no problem with a hidden vertical scroll bar.
... I also can't figure out how to dynamically control the images displayed. ...
The most easy way to fill the component is by assigning the Folder property to a path with images. Only the images with the file formats in the FileFormats property will be loaded. To specify the images manually (e.g. to combine multiple folders), use the FileNames property. When the Folder property is set, then the FileNames property is updated accordingly, but those file names are not stored in the DFM. When you change the file names (e.g. you delete one from the folder), then the Folder property is cleared and the component uses the FileNames property instead.
... Or how to update the grid based on keyboard events. ...
The only keystrokes currently implemented are Up, Down, PageUp, PageDown, Home and End which all scroll the control. What more key actions do you wish? It's a viewer.
Here is a screenshot of incorrect thumbnail painting. I can not get the thumbnails to look like the screenshot from the component in question. ... If the thumbnails were painted at the same XY as the rects painted in the first pass they would look much better.
While loading the images, a temporary rect is drawn with size ColWidth * RowHeight. All images are stretchdrawn within that size, so adjust your ratio of these properties to make the spacing equal everywhere. Note that you can also influence appearance with the ImageHorzAlign and ImageVertAlign properties.
Update:
The component you refer to is recently completely rewritten, and some of the answers above are outdated.
It now has a Propertional property that defaults to True, but when set False, it will stretch up the thumbs to whatever cell size you have set, independent from the original image sizes. Small images could remain narow though, unless you set the new Stretch property to True.
It now distinguishes between RowHeight and CellHeight, and ColWidth and CellWidth. The difference between both is CellSpacing.
The component does not descend from TScrollingWinControl anymore, but from TCustomControl and only the vertical scroll bar is added.

WP7 WebBrowser's transparent background (workaround)

It's not possible to set transparent background for WebBrowser of WP7. To make impression of transparent background I want to do the following workaround. I want:
To find a position and size of WebBrowser on the page.
To get page's background image.
Crop it with values what I found on step 1.
To save result in IsolatedStorage
To parse HTML and place <body background="RESULTBACKGROUND">
MyWebBrowser.NavigateToString(NewHtmlString);
I think this should be a workaround of transparent background and should work.
For now I am trying just to place any .jpg image (let's say test.jpg) on step 5.
But fail. I have "Build Action" property of file set to "Content". It is placed in the root of the project. And <body background="test.jpg"> not working. Back of the WebBrowser is still white.
What I am doing wrong?
UPD:
Step 5 is solved.
2Claus: No! Not only from web. I saved both html file and image file to IsolatedStorage and WebBrowser can show image as a backgroud.
Now the problem is that background cannot be fixed. I tried many differrent things with styles. I also tried to add a fixed div behind my text. Nothing works. The picture is always scrolling with a text. I tried to add onscroll event and pass it scrolled value to move the div in an opposite direction, but div is glued to the page :(
Any ideas?
So assuming you're talking about the WebBrowser control, you're forgetting that the HTML only can refer to urls on the world wide web.
So either you need to host your background images on a website, or you need to inject a CSS style that sets the background to either white or black (the two default background-colours of the platform).
For WebBrowser, You don't actually have to save it to the ISO to make changes on the page. You can load it navigate to it normally, and then use InvokeScript to make the changes via custom JS code. It can be a little tricky though, as you will probably need to heavily rely on the eval and stringization. The problem mentioned by Claus is still there - but you need to do some experiments. With the Mango release and SDK 7.1+, the platform support IsoltatedStorage imagesources in the form of is://path/file - maybe - maybe - maybe squared - the webbrowser's renderer udnerstands them too - then setting your bkg's url to such would work. I doubt though, as it could be seen as some minor security breach, etc
I now bumped into the same background fixed image problem. For someone wandering here I solved it placing content into a fixed-height container (div) therefore the container contents is being scrolled and not the html page, leaving background picture "fixed".
body
{
background-image:url('...');
background-position:-20px -150px;
background-repeat:no-repeat;
background-attachment:fixed;
}
div
{
height:300px;
overflow:scroll;
}
Of course background-position and div height is set specifically for a WebBrowser position in page and it's size.

Resources