Hello does anyone know how i can mask a text and photo in flutter? I already have my image with text on the screen. For example: my text would be Lion and my photo of these lions are behind it. How can i make a mask like you can in photoshop?
See this photo for example:
I'm not sure this answers your question. It's a simple version of text masking but instead of masking an image this MIN REPRO EXAMPLE shows masking gradient colors:
ShaderMask(
shaderCallback: (bounds) => RadialGradient(
colors: [
Colors.red,
Colors.green,
],
).createShader(bounds),
child: const Text('exclusive'),
),
Unfortunately, as of writing ShaderMask is not supported yet for web online for iOS/Android. Check out more here: https://github.com/flutter/flutter/issues/44152
You may find these answers useful (just again they may not be supported on web yet I don't know about other solutions):
Is there a way to show image inside text in flutter
texture (image) on text in flutter
Related
I am trying to view Gigapixxel image in flutter App.I want to Optimize the image size for reduce Data Usage and save the memory when open the image. User should be able to Zoom that image. How I can do that in Flutter ? (I want to zoom Image as google map)
Use this dependency Flutter Native Image its easy to use and will do the job you are looking for. It will reduce the size of the image and for zooming in just use this dependency and wrap it up with any widget you want. Photo View
Simple Usage of photo view
Container(
child: PhotoView(
imageProvider: AssetImage("your asset"),
)
);
Flutter native image:
To crop
File croppedFile = await FlutterNativeImage.cropImage(file.path, originX, originY, width, height);
To compress image:
File compressedFile = await FlutterNativeImage.compressImage(file.path,
quality: quality, percentage: percentage);
You have to give it a file from the file system and optionally provide a quality (1-100) and a resizing percentage (1-100). Each platform will use it's proper tools to handle the resizing.
The documentation of each dependency is your friend have a look at it, read a bit and use the code according to your needs.
So currently I'm trying to render a large image for example:
I tried CachedNetworkImageProvider from pub_dev.
I also tried various different Providers with combination of Image widget. None of them worked.
The only widget that allows me to render the image is photo_view which renders the 4k image but has Zoomable feature that I don't want to have.
How can I remove this feature and fit with BoxFit?
Libraries tried to render the image:
extended_image
image_ink_well
flutter_advanced_networkimage
When using PhotoView you can disable the zoom functionality.
IgnorePointer( // The PhotoView widget thinks there's nothing happening
// because you're catching any clicks that happen here.
child: PhotoView(
minScale: PhotoViewComputedScale.covered,
maxScale: PhotoViewComputedScale.covered,
),
),
You can read more about the PhotoView class here: https://pub.dev/documentation/photo_view/latest/photo_view/PhotoView-class.html
I have a blog hosted by Blogger with a custom template: http://www.drugchannels.net/
Images uploaded to the blog are hosted at X.bp.blogspot.com (where X is a number). Examples:
https://1.bp.blogspot.com/-Jwy2VQYRIEA/WqmwvsA07WI/AAAAAAAATA4/jWVcEts1h1Y4IXM0hD0njUhSmQ2AZPnxQCLcBGAs/s1600/Specialty_vs_Retail-2014_vs_2017.png
https://4.bp.blogspot.com/-O4S9ps4u67k/Wk0yhTEuV-I/AAAAAAAASUE/5tPedr-p7_4kedNYU4RY711l6K3maokiQCLcBGAs/s1600/DCI-Copay_Accumulator-03Jan2018-CORRECTED.png
I want to have a white background when the image is clicked. (The images look fine on the site itself. This is not a problem with the blog's background, which is set to be solid white.)
Using the Inspect option in Chrome, I see the following information
The body formatting (background: #0e0e0e;) does NOT appear anywhere on my blog or in my template.
How can I fix?
Thank you!
P.S. I have 10 years of legacy posts with images, so I need a global solution that changes the background to white for all images posted to the blog.
Wrap the image in a div and set the background color of that div with css. That should work
.divclass:active {
background:#FFFFFF
}
If you are opening the images in a new tab or window then your only option is changing the background of the images yourself with a photo editor. If you're just trying to give the user a full size view of an image when they click it you could use javascript/jquery and have a full size div with a background and an image pop up in full screen without sending them to the linked image. Theres probably quite a few jquery plugins that will do this with minimal coding knowledge, just google it.
Thanks, Riley.
I can't go back and edit hundreds of images, so the photo editor option won't work.
But based on your suggestion, I used the following solution:
1) Enabled "Showcase Images with Lightbox" on blogger
2) Added CSS from this page (http://www.howbloggerz.com/2016/05/how-to-customize-blogger-lightbox.html) with no background image and background color set ot white (#ffffff).
Downside is that charts/images now pop up on same page rather than opening in a new tab.
Thank you!
[![enter image description here][1whileHello,
I have an issue in Corona while displaying the same image(blue bar) two times to be displayed as continuous layout to seem as one continuous image, but the issue is that the output shows as there was an edge between both images, here is my code:
img1 = display.newImage("dialog_b_mid.png", _X/2, 770 )
display.newImage("dialog_b_mid.png", _X/2, 770 + img1.height)
and here is the output
You should use images without borders on any side, this image has top or bottom border, and it looks like an edge between two images.
Obviously, you must avoid gradients.
You can create an image using a software like Photoshop, just create a new (rectangle) file and fill it with a color.
You can also use patterns or parallax backgrounds, learn more on Google.
I have attached my output here, sorry to forgot the attachemnt in the main post.
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.