2 blocks sample in flex mode with 2 blocks side by side, block 1 with an image, block 2 with text in 2 parts, 1 part comment of the image and 1 part caption of the author of the image, how can I align part 1 on the top of the block and part 2 on the bottom
Related
I'm currently making a class wrapper in AutoHotkey for Scintilla (currently v5.0.1). I'm not sure what issue I'm having trying to make a text margin. It seems it should be incredibly simple. I'm just asking for help with order of operations using Scintilla (not for AHK help).
I'm trying to perform the following:
ctl := g.AddScintilla("vMyScintilla w500 h500")
m1 := ctl.Margin ; isolate Margin object from control (used internally)
m1.ID := 1 ; selecting margin ID (used internally by the class)
m1.Width := 100 ; setting margin width (SCI_SETMARGINWIDTHN)
m1.Type := 4 ; set margin type 4, text margin (SCI_SETMARGINTYPEN)
m1.Text(1,"asdf") ; SCI_MARGINSETTEXT (insert text to line 1)
msgbox m1.Text(1) ; try to get text from margin line 1 ... "asdf"
I see the margin extend itself to 100px as specified in the code (hard to miss). I left everything as 0-based, so margin 1 is the symbol margin after the number margin.
The msgbox at the end shows the text i put in the margin, so it appears to succeed, but the text is not displaying.
I have tried adding a style to the text with SCI_MARGINSETSTYLE, but it has had no effect. I've even changed my windows theme to make sure the text didn't happen to be the same color as the margin background, but that doesn't seem to be the case.
I get no errors from the AHK script.
I can't figure out what I'm missing. I've made it through over 50% of the Scintilla docs with no issues, but I'm stumped.
It was laughably simple.
I was testing on a single line document. And I set my "test line" to 1, instead of 0 (because it's 0-based).
I need to check if given PDF files are completely in CMYK color space. As you probably know, it is needed for printing.
Currently, it is done using GUI applications from Adobe, but it takes much time and we need to automate it with linux script.
I have tested many libraries, but each of them gave me invalid results or don't support newer PDF specs.
I haven't found solution for that in ghostscript
Exporting images from pdf is not good enough solution, since there are also paths and other media, which also need to be validated.
identify -verbose gives invalid results (bad colorspace, but also bad DPI).
As far as i know, PDF can have different color spaces for elements in document and I want to check if every element is in CMYK.
You can do this by pdfimages:
pdfimages -list filename.pdf
For a file with CMYK images, the output resembles:
page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
1 0 image 5197 6732 cmyk 4 8 jpeg no 5 0 600 601 32.3M 24%
1 1 mask 5197 6732 - 1 1 jpeg no 5 0 600 601 32.3M 775%
If all the images use an ICC profile, the output resembles:
page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
1 0 image 5197 6732 icc 3 8 jpeg no 8 0 600 601 7080K 6.9%
1 1 mask 5197 6732 - 1 1 jpeg no 8 0 600 601 7080K 166%
From a coding standpoint you need access to a tool that will render every page in the PDF document, but instead of actually drawing things it would need to call bottlenecks on each and every PDF drawing command.
From there you would need to intercept all color operators, all gstate operators, all image operators and recurse on all Form XObjects and flag everything that isn't CMYK. Note that some color spaces will be tricky, for example you can have a paletted color space that uses a CMYK ICC colorspace under the hood. You can also run into the case where an app sets the color to an RGB color, never marks the page, then switches to CMYK before marking.
I'm fairly new to the whole GTK game and want to create an algorithm to take screen shot of all monitors.
I was thinking something along these lines:
gdk_display_manager_list_displays
each display can have multiple screens (screens means monitors?) so use gdk_display_get_n_screens to get monitors per display from 1
get root gtk window of all screens from 2
create new Pixbuf for each root gtk window for each screen from 3 with gdk_pixbuf_new
fill each pixbuf from 4 with gdk_pixbuf_get_from_drawable for each respective root window from 3 for each respective screen from 2 for each respective display from 1 (may need to gdk_drawable_get_size and gdk_window_get_origin for each for args to pixbuf)
gdk_pixbuf_get_pixels for each pixbuf
Is this a workable solution?
If you are sure cRootWin is not NULL and cWidth and cHeight are greater than 0 then you should check for some additional problem mentioned by the doc.
A wild guess is your program does not have enough memory to store the pixmap (typically 6 Mb). I would try to allocate the 12 Mb just to see if this is the case.
I have a circle I divided it into 16 parts (4 segments in each of 4 quarters) and name each part by numbers 1,2,2,2 / 1,2,2,2 / 1,2,2,2 / 1,2,2,2.
I want to write an HTML5 and jQuery code to animate outline stork of circle by clicking on yellow part (1 piece of 16 parts is yellow; the others are gray). The program starts animation from where the yellow part is. The code should animate numbers around circle by changing its color and at the same time play a sound with each number. For example, if the animation receives part 1, its color changes to orange and plays the sound "hello"; and if the animation receives number 2, it plays sound "welcome" and changes its color to orange.
After each quarter of the circle, I want to have a little delay. For example, after playing quarter 1, the program should stop playing for 50sc and then start quarter 2 and so on. At the end of the process, the yellow part animates with glow light and stops playing.
I'm developing a UI using wxWidgets. I'm working with Visual Studio 2010 C++ Express.
My UI consists of 7 vertical grids and 1 horizontal grid which envelopes this 7. In each of these 7 grids, I have 2 or 3 bitmap buttons which are relatively ordered according to each other and neighbor grid boundaries. I set the main horizontal grid as sizer to the panel.
I want that these 7 grids always take place in the "middle" of my panel; which means: With every size adjustment, their coordinates should be recalculated and buttons should move to their newly calculated locations.
Is it possible to do this size adjustment with wxWidgets? I checked on the documentation and samples, but I couldn't find a simple example for my problem.
Thanks.
Write a resize event handler which recalculates the positions of the buttons and moves them to their new locations.
void myWindow::OnResize( wxSizeEvent& event )
{
wxSize sz = event.GetSize();
// calculate new positions
...
// move buttons to new locations
myButton->Move( x, y )'
}