FormEditarFotos is the built-in image editor for Explorador de Archivos. It opens automatically when you double-click a JPG, PNG, or GIF in the file explorer, and it usesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/XxLunaxX29/ExploradorDeArchivos/llms.txt
Use this file to discover all available pages before exploring further.
ImageProcessor.Adjust internally for all color transformations. From a single window you can fine-tune colors, annotate with a freehand brush, crop to a region of interest, and even see exactly where a photo was taken on an interactive map.
Opening an Image
Double-click from the file explorer
Double-clicking any supported image file calls
AbrirImagen(path) on the form, which loads the file into a Bitmap, stores the path as bitmap.Tag for metadata reading, and resets all adjustment sliders to zero.loadedBitmap (the untouched original) and workingBitmap (the editable copy shown on the canvas).
Color Adjustments
Three trackbars let you adjust the image non-destructively. Moving any slider immediately callsImageProcessor.Adjust with the current values and redraws the canvas.
| Slider | Range | Effect |
|---|---|---|
| Brightness | −100 to +100 | Shifts all channels lighter or darker |
| Contrast | −100 to +100 | Expands or compresses the tonal range |
| Saturation | −100 to +100 | Boosts or drains color intensity |
TrackBar_Scroll reads the three values and calls:
ImageProcessor.Adjust builds three separate 5×5 ColorMatrix objects (one each for contrast, saturation, and brightness) and multiplies them together before applying the combined matrix via ImageAttributes to produce a new Format32bppArgb bitmap.
btnRevert_Click) discards all changes by cloning loadedBitmap back into workingBitmap and resetting every slider — including the brush-size trackbar — to its default value.
Beyond the three sliders, three one-click filters are also available:
- Grayscale —
ImageProcessor.ApplyGrayscaleusing luminance weights (R 0.299, G 0.587, B 0.114). - Sepia —
ImageProcessor.ApplySepiawith classic warm-tone matrix coefficients. - Invert —
ImageProcessor.InvertColorsnegates each channel and shifts by 1.
Drawing
Toggle freehand drawing by clicking the Pincel button; its label changes to Pintando… while active. The editor tracks pen state with two fields:isDrawing— whether draw mode is currently on.lastPoint— the previous mouse position, used to draw smoothDrawLinesegments betweenMouseMoveevents.
LineCap.Round strokes directly onto workingBitmap via Graphics.FromImage.
| Control | Detail |
|---|---|
| Brush color | Click the color button to open ColorDialog; the chosen Color is stored in brushColor (default Color.Black). A preview panel updates immediately. |
| Brush size | trackBrushSize slider — minimum 1, default 5. Current value is shown in lblBrushSizeValue. |
Crop
Enable crop mode
Click the Recortar button.
isCropping is set to true and the button label becomes Recortando… (Click y arrastra).Draw the crop rectangle
Click and drag on the canvas. The editor records
cropStart on MouseDown and continuously updates cropRect (a Rectangle) on MouseMove. A red dashed border is drawn by the canvas_Paint handler so you can see the selection.cropRect.
GPS / Location
When an image is opened — whether via double-click or the Open button — the editor automatically searches for EXIF GPS data using the MetadataExtractor library. TheObtenerCoordenadas helper:
- Reads
bitmap.Tagto obtain the original file path. - Calls
ImageMetadataReader.ReadMetadata(path)to enumerate all EXIF directories. - Finds the first
GpsDirectoryand callsGetGeoLocation(). - Returns a
(double lat, double lon)tuple if coordinates are present, ornullotherwise.
- They are displayed in
txtCoordenadasas a decimal string, e.g.26.79692, 101.42861. MostrarMapaloads aWebView2control with an embedded Google Maps<iframe>centred on the location.- The Show Location button opens the same coordinates in the default browser.
txtCoordenadas shows “No se encontraron datos GPS.” You can still type coordinates manually in lat, lon format and click Ver to display them on the map.
GPS data requires the image to have been taken on a GPS-enabled device with location services active at the time of capture. Many photos — particularly those transferred from a scanner, exported from graphics software, or stripped of metadata — do not contain EXIF location tags.
Saving
Click Save As to open aSaveFileDialog. The modified workingBitmap is written to disk using System.Drawing.Imaging.ImageFormat:
| Filter choice | Format saved |
|---|---|
| PNG | ImageFormat.Png |
| JPEG | ImageFormat.Jpeg |
0x0001–0x0004) back into the file using Bitmap.SetPropertyItem. If that step fails, the file is saved without GPS data and a warning is shown.