wxWidgets wxRichTextCtrl no horizontal scrolling - wxwidgets

Why horizontal scrolling doesn't work ?
wxRichTextCtrl richtext = new wxRichTextCtrl(splitter, wxID_ANY, wxEmptyString,
wxPoint(5, 5), wxSize(200, 150), wxRE_MULTILINE | wxHSCROLL);

Related

How to add a color or calibration bar

I would like to append a color bar to my image to indicate what value corresponds to which color.
Something similar to the calibration bar in ImageJ.
Thank you for your help
What you are looking for is the "Intensity bar".
Example script right from the F1 help documenation:
image img := RealImage("Test",4,512,512)
img = itheta
img.ShowImage()
imageDisplay disp = img.ImageGetImageDisplay(0)
number kSCALEBAR = 31
number kINTENSITYBAR = 33
component scalebar = NewComponent( kSCALEBAR, 450, 100, 480, 300 )
disp.ComponentAddChildAtEnd( scalebar )
component intbar = NewComponent( kINTENSITYBAR, 50, 400, 450, 490 )
disp.ComponentAddChildAtEnd( intbar )

Cut out a custom shape from an image in P5.js

I am trying to create jigsaw puzzle shapes using P5.js. After creating puzzle shapes, I want to cut areas from main image into pieces. For that I have options of using GET() or COPY():
But both of them take fix height and width as parameter. How can I copy a custom area like given in following shapes:
https://editor.p5js.org/techty/sketches/h7qwatZRb
let cutout = createGraphics(w, h);
cutout.background(255, 255);
cutout.blendMode(REMOVE);
//draw shape on cutout
let newshapeimagegraphic = createGraphics(w, h);
newshapeimagegraphic.image(myImg, 0, 0);
newshapeimagegraphic.blendMode(REMOVE);
newshapeimagegraphic.image(cutout, 0, 0);
image(newshapeimagegraphic, 0, 0);

Is an AlphaMaskFilter correct in this case?

I am trying to use an alppha mask filter to apply a texture to a canvas element but cannot seem to get things to work. I have a base image which is a flat white color and to which I want to apply a color filter at runtime based on a users selection for example:
bitmap = new createjs.Bitmap(image);
bitmap.filters = [
new createjs.ColorFilter(0,0, 0.5, 1, 0, 0, 120, 0)
];
bitmap.cache(0, 0, 500, 500, 2);
I then want to use a second image which is a texture png that will add various shading texture to that first one. Looking over the docs it would seem that I need to use an AlphaMaskFilter but that does not seem to work and nothing is rendered onto the canvas. For example:
//filterImage contains the transparent image which has a shaded texture
var bitmap2 = new createjs.Bitmap(filterImage);
bitmap2.cache(0, 0, 500, 500, 2);
var bitmap = new createjs.Bitmap(image);
bitmap.filters = [
new createjs.ColorFilter(0,0, 0.5, 1, 0, 0, 120, 0),
new createjs.AlphaMaskFilter(bitmap2.cacheCanvas)
];
bitmap.cache(0, 0, 500, 500, 2);
Can someone help point me in the right direction here or if I am trying to do something which is just not possible using that filter.

Fit text in to a shape using gd library

I am trying to put a text of any length (up to 15) in a shape like in below image using gd library. The width of shape should expand/reduce according to the text length. I know how to write simple text using gd library, but i am stuck on how to make this ?
I am trying something similar like this
<?php
// Set the content-type
header('Content-Type: image/png');
$im = imagecreate(400, 300);
// Background color
$white = imagecolorallocate($im, 255, 255, 255);
// font color
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// text string
$text = 'ABCDEFG';
$font = 'arial.ttf';
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
imagepng($im);
imagedestroy($im);
?>
I tried creating text to image... now i want to fit that text in a shape... if the length of text increases the width of the shape has to be increased... and i m stuck on how to do this.
How can i achieve this ? any idea on this ?

How to add a overlay text on captured video/image in swift?

I want to add a overlay text like "Company watermark" on captured video or image programatically in swift. any help will be appreciated.
// create text Layer
let titleLayer = CATextLayer()
titleLayer.backgroundColor = UIColor.whiteColor().CGColor
titleLayer.string = "Company watermark"
titleLayer.font = UIFont(name: "Helvetica", size: 28)
titleLayer.shadowOpacity = 0.5
titleLayer.alignmentMode = kCAAlignmentCenter
titleLayer.frame = CGRectMake(0, 50, size.width, size.height / 6)
yourView.layer.addSublayer(titleLayer)
Hope it will help you for adding text in video.