twig / dcxdll

Dialog Control eXtensions for mIRC
BSD 3-Clause "New" or "Revised" License
23 stars 2 forks source link

Image - new proposals to fix and improve for updating #56

Closed EpicNet closed 2 years ago

EpicNet commented 3 years ago

I am using "mIRC v7.66" + "DCX dll v3.1-git428" in system "Windows 8.1 x64".

When I used this control, I ran into a lack of presence of a number of functions, which might be helpful. If possible, I would like to receive extended support for working with images in different extensions. Thanks.

My proposals for what needs to be corrected and added in "Image", to make it maximally functional and beautiful:

  1. Add a new type of border with to customizable the thickness in pixels. For example +a new flag: "/xdid -x dcx 4 +a 1".
  2. Add to new type of border possibility to color customization. For example +a new flag: "/xdid -C dcx 4 +a $rgb(255,0,0)".
  3. Add a new identifier property to count the number of images in the "GIF" file.
  4. Add the ability to select the image number from the "GIF" file, which will be displayed in the control.
  5. Add a new flag +g to enable looped frame-by-frame animation in the "GIF" file. For example: "/xdid -i dcx 4 +g file.gif".
  6. Add a new flag +u to display the image by direct link "URL". For example: "/xdid -i dcx 4 +u http://domen/file.gif".
  7. Add a new flag +r to preserve the aspect ratio of the image when set to the specified dimensions of the control. For example: "/xdid -i dcx 4 +r file.gif".

P.S. Perhaps I did not take into account something, forgot to mention or lost sight of what else needs to be done, or on the contrary, made a request about something useless, or maybe after that you have new interesting ideas, therefore, in order to avoid misunderstandings expressed in multiple corrections and rewriting of the code - we can always preliminarily think about this update and discuss in detail the innovations in the chat, so that this control becomes versatile enough, functional, maximally customizable and suitable for any design, in a own peculiar style. Thanks.


image image

Here is a test piece of script to reproduce this the problem. To run the script click on "F5" or enter the command "/image_test":

alias F5 { image_test }
alias image_test {
  if ($dialog(image_test)) .dialog -x image_test
  else { .dialog -m image_test image_test }
}
dialog image_test {
  title "Image test"
  icon $mircexe,0
  option pixels
  size -1 -1 550 350
}
on *:DIALOG:image_test:init:*:{
  .dcx Mark $dname image_test_work
  .xdialog -b $dname +ty
  .xdialog -g $dname +b $rgb(20,20,27)
  .xdialog -c $dname 1 image 30 25 490 300 notheme
  .xdid -x $dname 1 +b
  .xdid -S $dname 1 1
  .xdid -J $dname 1 +r sizeall
  .xdid -C $dname 1 +b $rgb(40,40,47)
  var %image_path image\gif\file1.gif
  if ($exists(%image_path)) .xdid -i $dname 1 +ah %image_path
}
alias image_test_work {}
OokEek commented 3 years ago

No.3 can already be done with $pic(filename).frames No.5 has been added. No.7 has been added.

twig commented 3 years ago

@OokEek maybe use styles upon creation for 5 and 7 instead of wasting flags on these?

EpicNet commented 3 years ago

By the way, yes, could of course try to do it using styles animation and fixratio, but also add the ability to disable "0" and enable "1" these styles on the fly, in case their use would be unnecessary in the created control.

Style animation - to automatic start of a looped animated image in the format "GIF". (There is no animation without this style). Style fixratio - to keep the aspect ratio of the image within the size of the control.

Which control method is more convenient (styles or commands), it will be possible to find out only after practical use.

P.S. Please, if possible, after each small set of working changes in the code, do build the file "dcx.dll (beta)" from the source code, so that we can immediately test the update and leave comments in case of errors. Thanks.